如何给命令多个名称?

cro*_*sap 0 python discord discord.py

我有一个命令:

@bot.command(pass_context=True)
async def hellothere(ctx):
   await Bot.say("Hello {}".format(ctx.message.author))
Run Code Online (Sandbox Code Playgroud)

我想复制此命令,使其更短。

我试过了:

@bot.command(pass_context=True)
async def hello(ctx):
   hellothere(ctx)
Run Code Online (Sandbox Code Playgroud)

但是我收到一条错误消息,指出该错误Command不可调用。

有谁知道如何做到这一点?

小智 7

@client.command(pass_context = True , aliases=['purge', 'clean', 'delete'])

只需更改别名即可。