1
0
Fork 0
mirror of synced 2024-06-01 18:29:38 +12:00

Logging command usage, as it appears to be detecting the parent command for subcommands

This commit is contained in:
phxntxm 2016-09-30 13:02:41 -05:00
parent 576a8a054b
commit e40b03f942

9
bot.py
View file

@ -94,6 +94,15 @@ async def on_message(message):
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: {}\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):