From 4492dae059acea15fda0556f34a3a557baafe795 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 14 Feb 2023 12:21:32 +0100 Subject: [PATCH] add money bag give coin function --- coin.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/coin.rb b/coin.rb index d634b3e..852327c 100644 --- a/coin.rb +++ b/coin.rb @@ -8,6 +8,7 @@ COIN_TIMEOUT = 15 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"' COIN_EMOJI = '🪙' +BAG_EMOJI = '💰' $coin_state_active = false $coins_offered_today = 0 @@ -93,8 +94,16 @@ def give_coin(event) return 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}>!" end @@ -125,7 +134,7 @@ event.respond "OHHHHHH IM GONNA CUM" end 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 get_coin(event)