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())
评论列表
文章目录