def oncommandcompletion(self, command, ctx):
if self.debug:
# We're Debugging
timeStamp = datetime.today().strftime("%Y-%m-%d %H.%M")
msg = '{}{}:\n"{}"\nCompleted at {}\nBy {}\nOn {}'.format(ctx.prefix, command, ctx.message.content, timeStamp, ctx.message.author.name, ctx.message.server.name)
if os.path.exists('debug.txt'):
# Exists - let's append
msg = "\n\n" + msg
msg = msg.encode("utf-8")
with open("debug.txt", "ab") as myfile:
myfile.write(msg)
else:
msg = msg.encode("utf-8")
with open("debug.txt", "wb") as myfile:
myfile.write(msg)
评论列表
文章目录