Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to give a command multiple names?

I have a command:

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

I want to make a copy of this command that is shorter.

I tried:

@bot.command(pass_context=True)
async def hello(ctx):
   hellothere(ctx)

But I received an error stating that Command is not callable.

Does anyone know how to do this?

like image 653
crousap Avatar asked Nov 27 '22 23:11

crousap


1 Answers

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

Just change the aliases.

like image 91
avib Avatar answered Dec 05 '22 03:12

avib