forked from mud/bankerbot-rb
Compare commits
5 Commits
c6fc4cdf0e
...
899a496f14
Author | SHA1 | Date | |
---|---|---|---|
899a496f14 | |||
d61f9543fb | |||
a9a313aa02 | |||
56f54bed6a | |||
8014f90e2c |
15
coin.rb
15
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)
|
||||
@ -65,9 +67,11 @@ 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?
|
||||
event.respond "Bots don't get coins!"
|
||||
end
|
||||
coin_state_active = false
|
||||
if(rand(100) == 47)
|
||||
hyper_coin_amount = rand(100)
|
||||
@ -87,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
|
||||
|
Loading…
Reference in New Issue
Block a user