【发布时间】:2022-01-18 00:56:56
【问题描述】:
我一直在尝试使用多个冷却时间(用于无效命令和命令冷却时间),但对于两个 on_command_error 事件,我都得到了 Redefinition of usage。
这是我目前拥有的:
@client.event
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandNotFound):
myEmbed1000 = discord.Embed(description=f":x: {random.choice(silly_e)} {ctx.author.name}, that is not a vaild command!", color=0xDD2E44)
await ctx.reply(embed=myEmbed1000)
@client.event
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
cooldownem = discord.Embed(description=f"{random.choice(silly_e)} **{ctx.author.name}**, please wait after {round(error.retry_after)} second(s)!", color=0xfae93a)
await ctx.reply(embed=cooldownem)
【问题讨论】:
标签: python discord discord.py