bot.py 文件源码

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

项目:pineapple 作者: peter765 项目源码 文件源码
def on_message(message):
    """
    Event handler, fires when a message is received in the server.
    :param message: discord.Message object containing the received message
    """
    try:
        if message.content.startswith(pm.botPreferences.commandPrefix) and client.user.id != message.author.id:
            # Send the received message off to the Plugin Manager to handle the command
            words = message.content.partition(' ')
            await pm.handle_command(message, words[0][len(pm.botPreferences.commandPrefix):], words[1:])
        elif message.server is not None:
            await pm.handle_message(message)
    except Exception as e:
        await client.send_message(message.channel, "Error: " + str(e))
        if pm.botPreferences.get_config_value("client", "debug") == "1":
            traceback.print_exc()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号