Merge branch 'main' of git.poto.cafe:mud/bankerbot-rb

This commit is contained in:
mud mud 2022-10-20 11:20:29 +02:00
commit dc32fb3dcc
Signed by: mud
GPG Key ID: D29C9385CC54F61C

View File

@ -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
@ -96,6 +96,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