1
0
Fork 0
mirror of synced 2024-06-22 16:20:23 +12:00

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

This commit is contained in:
phxntxm 2016-10-01 00:40:03 -05:00
parent 6d92482f50
commit a984f97b21

16
bot.py
View file

@ -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)