From 8014f90e2ca1e6c4cb3eb3fe0e36cacdbab9b97a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Fri, 28 Oct 2022 01:15:20 +0300 Subject: [PATCH 1/3] no bots --- coin.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/coin.rb b/coin.rb index 278a1df..80069c5 100644 --- a/coin.rb +++ b/coin.rb @@ -68,8 +68,11 @@ bot.message(content: 'GET COIN' ) do |event| next if event.author.role? 'robot friend' # update score if coin_state_active + if event.author.bot_account? + event.respond "Bots don't get coins!" + end coin_state_active = false - if(rand(100) == 47) + if(rand(100) == 47) hyper_coin_amount = rand(100) coins = increment_coin(event.author.id, hyper_coin_amount) event.respond "What astounding luck!!! #{clean_name event.author.display_name}, you've just activated HYPER COIN EVENT and have received #{hyper_coin_amount} coins for a grand total of #{coins} coins!" @@ -89,7 +92,7 @@ end bot.run(true) -loop do +loop do # sleep random amount of time between 1 and 4 hours sleep(get_random_hours(1, 4)) # activate coin state From a9a313aa0215a1cae4dc6247fadd3edbbe0b2e2f Mon Sep 17 00:00:00 2001 From: mud mud Date: Thu, 27 Oct 2022 22:18:22 +0000 Subject: [PATCH 2/3] Update 'coin.rb' --- coin.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/coin.rb b/coin.rb index 80069c5..435d339 100644 --- a/coin.rb +++ b/coin.rb @@ -65,7 +65,6 @@ bot.message(in: Integer(ENV['BOT_CHANNEL'])) do |event| end bot.message(content: 'GET COIN' ) do |event| - next if event.author.role? 'robot friend' # update score if coin_state_active if event.author.bot_account? From d61f9543fb3af7f7b720ca944fd3d37aa36a09cf Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 4 Nov 2022 14:31:32 +0100 Subject: [PATCH 3/3] aggressive bot wars --- coin.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/coin.rb b/coin.rb index 435d339..1d5b4db 100644 --- a/coin.rb +++ b/coin.rb @@ -6,6 +6,9 @@ require 'discordrb' MAX_COINS_PER_DAY = 3 COIN_TIMEOUT = 15 SCOREBOARD = './scoreboard.yml' +DUMBASS = 521596582962003968 +DUMBASS_BOT = 1034966228755820575 + coin_state_active = false coins_offered_today = 0 @@ -57,7 +60,6 @@ def clean_name(input) 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! #{clean_name event.author.display_name}, your coin balance has now been emptied. Let that be a lesson for next time!" empty_coin(event.author.id) @@ -89,6 +91,13 @@ bot.message(with_text: '/coins') do |event| event.respond "#{clean_name event.author.display_name}, you have #{plural('coin', coins)}!" end +bot.message(from: DUMBASS_BOT) do |event| + next unless event.message.content.scan(/(?=no swearing)/).count > 0 + coins = increment_coin(DUMBASS, -1) + event.respond "<@#{DUMBASS}>, you have been penalized 1 coin for the grossly negligent behavior of your Intellectual Offspring! You now have #{plural('coin', coins)}." + +end + bot.run(true) loop do