forked from mud/bankerbot-rb
add money bag give coin function
This commit is contained in:
parent
8245932e33
commit
4492dae059
15
coin.rb
15
coin.rb
@ -8,6 +8,7 @@ COIN_TIMEOUT = 15
|
|||||||
SCOREBOARD = './scoreboard.yml'
|
SCOREBOARD = './scoreboard.yml'
|
||||||
PASTA='You know what? Im done, i am leaving, we were friendly talking about the subject. This crossed the line of "ok killer of joy" to "no fun allowed"'
|
PASTA='You know what? Im done, i am leaving, we were friendly talking about the subject. This crossed the line of "ok killer of joy" to "no fun allowed"'
|
||||||
COIN_EMOJI = '🪙'
|
COIN_EMOJI = '🪙'
|
||||||
|
BAG_EMOJI = '💰'
|
||||||
|
|
||||||
$coin_state_active = false
|
$coin_state_active = false
|
||||||
$coins_offered_today = 0
|
$coins_offered_today = 0
|
||||||
@ -93,8 +94,16 @@ def give_coin(event)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
increment_coin(event.message.author.id)
|
|
||||||
increment_coin(event.user.id, -1)
|
coin_amount = 0
|
||||||
|
if event.emoji.name == COIN_EMOJI
|
||||||
|
coin_amount = 1
|
||||||
|
elsif event.emoji.name == BAG_EMOJI
|
||||||
|
coin_amount = 20
|
||||||
|
end
|
||||||
|
|
||||||
|
increment_coin(event.message.author.id, coin_amount)
|
||||||
|
increment_coin(event.user.id, -coin_amount)
|
||||||
|
|
||||||
event.respond "How nice! <@#{event.message.author.id}> has received a coin from <@#{event.user.id}>!"
|
event.respond "How nice! <@#{event.message.author.id}> has received a coin from <@#{event.user.id}>!"
|
||||||
end
|
end
|
||||||
@ -125,7 +134,7 @@ event.respond "OHHHHHH IM GONNA CUM"
|
|||||||
end
|
end
|
||||||
|
|
||||||
bot.reaction_add do |event|
|
bot.reaction_add do |event|
|
||||||
next unless event.emoji.name == COIN_EMOJI
|
next unless [COIN_EMOJI, BAG_EMOJI].include? event.emoji.name
|
||||||
|
|
||||||
if event.message.author.id == bot.bot_application.id
|
if event.message.author.id == bot.bot_application.id
|
||||||
get_coin(event)
|
get_coin(event)
|
||||||
|
Loading…
Reference in New Issue
Block a user