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:
parent
6d92482f50
commit
a984f97b21
1 changed files with 3 additions and 13 deletions
16
bot.py
16
bot.py
|
@ -93,23 +93,13 @@ async def on_message(message):
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_command_completion(command, ctx):
|
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
|
# 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))
|
bot.loop.create_task(process_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)
|
|
||||||
|
|
||||||
|
|
||||||
async def process_command(command, ctx):
|
async def process_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
|
|
||||||
author = ctx.message.author
|
author = ctx.message.author
|
||||||
server = ctx.message.server
|
server = ctx.message.server
|
||||||
|
command = ctx.command
|
||||||
|
|
||||||
r_filter = {'command': command.qualified_name}
|
r_filter = {'command': command.qualified_name}
|
||||||
command_usage = await config.get_content('command_usage', r_filter)
|
command_usage = await config.get_content('command_usage', r_filter)
|
||||||
|
|
Loading…
Reference in a new issue