UsoDiscord.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:Uso-Bot 作者: Renondedju 项目源码 文件源码
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>")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号