From 97e21089685a6fb541b0cbc5f5adce9e627600d7 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 20 Oct 2022 11:20:05 +0200 Subject: [PATCH] disable coin state as soon as GET COIN is received --- coin.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/coin.rb b/coin.rb index f683ac5..6a73b56 100644 --- a/coin.rb +++ b/coin.rb @@ -63,6 +63,7 @@ end bot.message(content: 'GET COIN' ) do |event| # update score if coin_state_active + coin_state_active = false if(rand(100) == 47) hyper_coin_amount = rand(100) coins = increment_coin(event.author.id, hyper_coin_amount) @@ -71,9 +72,6 @@ bot.message(content: 'GET COIN' ) do |event| coins = increment_coin(event.author.id) event.respond "Nice catch, #{event.author.display_name}! You have #{plural('coin', coins)} now!" end - - coin_state_active = false - else event.respond "No coins for you, #{event.author.display_name}!" end