如何在discord.py中添加多个命令

如何在discord.py中添加多个命令,discord.py,Discord.py,如何在discord.py中添加多个命令?如果我们将另一个命令放在它的正下方,该命令将不起作用要创建一个新命令,您只需创建一个新的命令引用: 守则: @client.command() async def command_1(ctx): await ctx.send("This is command #1") @client.command() async def command_2(ctx): await ctx.send("THis is c

如何在discord.py中添加多个命令?如果我们将另一个命令放在它的正下方,该命令将不起作用

要创建一个新命令,您只需创建一个新的命令引用:

守则:

@client.command()
async def command_1(ctx):
    await ctx.send("This is command #1")


@client.command()
async def command_2(ctx):
    await ctx.send("THis is command #2")

因此,对于每个命令,您只需创建一个新的
client.command()
和async def函数

您可以通过包含您尝试的代码来为我们提供吗?告诉我们问题出在哪里?请提供更多的细节,代码,你有什么错误。。。也请阅读