python - 如何给一个命令多个名称?

标签 python discord discord.py

我有一个命令:

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

我想复制一个更短的命令。

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

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

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

最佳答案

@client.command(pass_context = True , aliases=['purge', 'clean', 'delete'])
只需更改别名。

关于python - 如何给一个命令多个名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50204867/

相关文章:

python - Discord.py 给成员添加角色

python - 如何在给定时间后插入用于随机化和操作的命令

python - 如何根据非简单标准执行 DataFrames 与 Pandas 的内部或外部连接

javascript - 读取文件附件(例如;.txt 文件)-Discord.JS

python - 使用权重分配整数?如何计算?

javascript - Discordjs bot (Nodejs) 如何使用reactjs将数据添加到DOM

python - 如何通过discord.py重写来分配角色?

python - 在 discord.py 中手动触发事件

python - 使用窗口函数时出现 pyspark 错误(Spark 2.1.0 报告未找到列的问题)?

python - 导入featuretools和AttributeError : module 'tornado.platform.asyncio' has no attribute 'AnyThreadEventLoopPolicy'