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