From dceabb23c3f4cd4d2e6b69de49462dcd657f5977 Mon Sep 17 00:00:00 2001 From: mud mud Date: Tue, 11 Oct 2022 17:07:13 +0000 Subject: [PATCH 1/2] use author display_name for fraud coins --- coin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coin.rb b/coin.rb index f683ac5..df4cde5 100644 --- a/coin.rb +++ b/coin.rb @@ -55,7 +55,7 @@ end bot.message(in: Integer(ENV['BOT_CHANNEL'])) do |event| puts event.message if event.message.attachments.count { |x| x.filename.scan(/coin*/).length > 0 } > 0 - event.respond "Oh no! Looks like you tried to post a fradulent coin! #{event.author.name}, your coin balance has now been emptied. Let that be a lesson for next time!" + event.respond "Oh no! Looks like you tried to post a fradulent coin! #{event.author.display_name}, your coin balance has now been emptied. Let that be a lesson for next time!" empty_coin(event.author.id) end end From 0ffc771d09e480d1f2dac1e84abfc90d28ee795f Mon Sep 17 00:00:00 2001 From: mud mud Date: Sat, 15 Oct 2022 07:16:40 +0000 Subject: [PATCH 2/2] add random offset to starting out coin handouts after midnight --- coin.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/coin.rb b/coin.rb index df4cde5..3e34f35 100644 --- a/coin.rb +++ b/coin.rb @@ -98,6 +98,7 @@ loop do # if max coins per day has reached, sleep until midnight if coins_offered_today >= MAX_COINS_PER_DAY sleep(get_seconds_to_midnight(Time.now)) + sleep(get_random_hours(0, 11)) coins_offered_today = 0 end end