events.py 文件源码

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

项目:Nurevam 作者: Maverun 项目源码 文件源码
def on_command_completion(self,ctx):
        if ctx.command.cog_name is None or isinstance(ctx.message.channel,discord.DMChannel):
            return
        try:
            print(ctx.command.cog_name)
            check = await self.bot.db.redis.hgetall("{}:Config:Delete_MSG".format(ctx.message.guild.id))
            if check.get(ctx.command.cog_name.lower()) == "on":
                await ctx.message.delete()
            await self.redis.hincrby("{0.guild.id}:Total_Command:{0.author.id}".format(ctx.message),ctx.invoked_with, increment=1)
            await self.redis.hincrby("Info:Total_Command", ctx.invoked_with, increment=1)
            await self.redis.hincrby("{0.guild.id}:Total_Command:User:{0.author.id}".format(ctx.message),ctx.invoked_with, increment=1)
        except:
            utils.prRed("Failed to delete user command - {0.name}  - {0.id}\n".format(ctx.message.guild))
            utils.prRed(traceback.format_exc())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号