如何在我的命令中创建一个不再是 useitem 而是使用 item 的空格?
因为目前输入这样的命令看起来很不正经
@client.command()
async def use20items (ctx):
Pflanzen= await ctx.send ('**test**')
await asyncio.sleep(10)
await Pflanzen.edit(content='message')
答案 0 :(得分:1)
您可以在装饰器中传递命令的名称:
@client.command(name="use item")
async def ...
答案 1 :(得分:0)
您可以使用别名添加空格,如下例所示:
@client.command(aliases=["use item"])
async def use_item(ctx):
...
我可以看到您在 use20items
和 (ctx)
之间有一个空格,而 ctx.send
和 ('**test**')
这样做可能会导致错误。
我希望这会有所帮助。