bot.py 文件源码

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

项目:DHV2 作者: DuckHunt-discord 项目源码 文件源码
def on_command(command, ctx):
    bot.commands_used[command.name] += 1
    await comm.logwithinfos_message(ctx.message, str(command) + " (" + ctx.message.clean_content + ") ")
    if prefs.getPref(ctx.message.server, "delete_commands") and checks.is_activated_check(ctx.message.channel):
        try:
            await bot.delete_message(ctx.message)
        except discord.Forbidden:
            await comm.logwithinfos_ctx(ctx, "Error deleting message: forbidden.")
        except discord.NotFound:
            await comm.logwithinfos_ctx(ctx, "Error deleting message: not found (normal if the purgemessages command was used).")


            # message = ctx.message
            # destination = None
            # if message.channel.is_private:
            #    destination = 'Private Message'
            # else:
            #    destination = '#{0.channel.name} ({0.server.name})'.format(message)
            #
            # log.info('{0.timestamp}: {0.author.name} in {1}: {0.content}'.format(message, destination))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号