From a984f97b213702ae8293cac9f4233fa7cefe0ad3 Mon Sep 17 00:00:00 2001 From: phxntxm Date: Sat, 1 Oct 2016 00:40:03 -0500 Subject: [PATCH] The command passed to the event was the parent command, and not the command that was actually invoked, for subcommands. We want that for our purposes, so this has been udpated to match --- bot.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/bot.py b/bot.py index 5725437..a0c266f 100644 --- a/bot.py +++ b/bot.py @@ -93,23 +93,13 @@ async def on_message(message): @bot.event async def on_command_completion(command, ctx): # There's no reason to continue waiting for this to complete, so lets immediately launch this in a new future - bot.loop.create_task(process_command(command, ctx)) - now = datetime.datetime.now() - - fmt = "In server '{0.message.server}' at {1}\n" \ - "Full message: `{0.message.content}`\n" \ - "Command detected was: {2}\n" \ - "ctx command would be: {0.command.qualified_name}\n\n".format( - ctx, str(now), command.qualified_name) - with open('command_log', 'a') as l: - print(fmt, file=l) + bot.loop.create_task(process_command(ctx)) -async def process_command(command, ctx): - # This try catch is only here while this is first being implemented - # It will be removed once I ensure this is working correctly +async def process_command(ctx): author = ctx.message.author server = ctx.message.server + command = ctx.command r_filter = {'command': command.qualified_name} command_usage = await config.get_content('command_usage', r_filter)