disable coin state as soon as GET COIN is received

This commit is contained in:
mud mud 2022-10-20 11:20:05 +02:00
parent 2ebe97ebcd
commit 97e2108968
Signed by: mud
GPG Key ID: D29C9385CC54F61C

View File

@ -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