def on_command_error(exception, context):
#Colors
Color_Off='\x1b[0m'
Red='\x1b[1;31;40m'
Yellow='\x1b[1;33;40m'
message = context.message
channel = message.channel
if not message.channel.is_private and not message.content.startswith(commandPrefix + 'mute'):
cursor.execute("SELECT state FROM server WHERE serverID = ?", (str(message.server.id),))
if cursor.fetchall()[0][0] == 'on':
channel = message.author
else:
channel = message.channel
errors = traceback.format_exception(type(exception), exception, exception.__traceback__)
output = ''
for line in errors:
output += line
await Log(message, content = "Message:\n" + message.content + "\n\n```" + output + "```", logLevel=2)
await client.send_message(channel, "Oops ! Unexpected error :/\nGo to my personal server to ask for some help if needed !\n<https://discord.gg/Qsw3yD5>")
评论列表
文章目录