don't double reply to command messages
This commit is contained in:
parent
964aaaaed6
commit
f9fc24b359
9
main.rb
9
main.rb
@ -19,6 +19,7 @@ config_obj = YAML::load_file( './config.yaml' )
|
||||
logger.info("loaded config")
|
||||
bot = Discordrb::Commands::CommandBot.new token: config_obj["bot_token"], prefix: "!folder"
|
||||
folder = Folder.new
|
||||
responded = false
|
||||
|
||||
def shut_down(bot,folder)
|
||||
if bot.connected?
|
||||
@ -41,6 +42,7 @@ bot.message(private: true,contains: "!folder fall") do |event|
|
||||
else
|
||||
event.respond("Oh that you could be so blessed as to have that option")
|
||||
end
|
||||
responded = true
|
||||
end
|
||||
|
||||
bot.message(private: true,contains: "!folder rise") do |event|
|
||||
@ -52,17 +54,24 @@ bot.message(private: true,contains: "!folder rise") do |event|
|
||||
else
|
||||
event.respond("Fat chance, non-Steve")
|
||||
end
|
||||
responded = true
|
||||
end
|
||||
|
||||
bot.message(private: true, contains: "!folder help") do |event|
|
||||
event.respond("Commands: rise,fall,help,status")
|
||||
responded = true
|
||||
end
|
||||
|
||||
bot.message(private: true, contains: "!folder status") do |event|
|
||||
event.respond("Stevefolder has #{folder.num_subs} submissions")
|
||||
responded = true
|
||||
end
|
||||
|
||||
bot.message(private: true) do |event|
|
||||
if responded
|
||||
responded = false
|
||||
break
|
||||
end
|
||||
sender = event.author.id
|
||||
i = 1
|
||||
updated = false
|
||||
|
Loading…
Reference in New Issue
Block a user