Skip to content

Commit

Permalink
anonymous command logging for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac-To committed Jul 6, 2021
1 parent 437be37 commit cdf95cf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions basicbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#built in
import os
import subprocess
import time
#self
import ui

Expand Down Expand Up @@ -64,6 +65,12 @@ async def on_ready():
async def on_command_error(ctx, error):
await ctx.send(error)

@bot.event
async def on_message(message):
if message.content.startswith(prefix) and message.author != bot.user:
print(time.strftime("%H:%M:%S", time.localtime()), bot.user.id, message.content)
await bot.process_commands(message)

#start bot
try:
bot.run(token)
Expand Down

0 comments on commit cdf95cf

Please sign in to comment.