Revert "don't double reply to command messages"

This reverts commit f9fc24b359.
This commit is contained in:
stryan 2022-07-05 22:44:18 -04:00
parent f9fc24b359
commit 4e5ad353a4

View File

@ -19,7 +19,6 @@ config_obj = YAML::load_file( './config.yaml' )
logger.info("loaded config") logger.info("loaded config")
bot = Discordrb::Commands::CommandBot.new token: config_obj["bot_token"], prefix: "!folder" bot = Discordrb::Commands::CommandBot.new token: config_obj["bot_token"], prefix: "!folder"
folder = Folder.new folder = Folder.new
responded = false
def shut_down(bot,folder) def shut_down(bot,folder)
if bot.connected? if bot.connected?
@ -42,7 +41,6 @@ bot.message(private: true,contains: "!folder fall") do |event|
else else
event.respond("Oh that you could be so blessed as to have that option") event.respond("Oh that you could be so blessed as to have that option")
end end
responded = true
end end
bot.message(private: true,contains: "!folder rise") do |event| bot.message(private: true,contains: "!folder rise") do |event|
@ -54,24 +52,17 @@ bot.message(private: true,contains: "!folder rise") do |event|
else else
event.respond("Fat chance, non-Steve") event.respond("Fat chance, non-Steve")
end end
responded = true
end end
bot.message(private: true, contains: "!folder help") do |event| bot.message(private: true, contains: "!folder help") do |event|
event.respond("Commands: rise,fall,help,status") event.respond("Commands: rise,fall,help,status")
responded = true
end end
bot.message(private: true, contains: "!folder status") do |event| bot.message(private: true, contains: "!folder status") do |event|
event.respond("Stevefolder has #{folder.num_subs} submissions") event.respond("Stevefolder has #{folder.num_subs} submissions")
responded = true
end end
bot.message(private: true) do |event| bot.message(private: true) do |event|
if responded
responded = false
break
end
sender = event.author.id sender = event.author.id
i = 1 i = 1
updated = false updated = false