2024-06-06 17:41:50 发布
网友
我的问题很简单,我不知道以前是否有人回答过,因为我找不到答案。所以我尝试这样的想法,当有人键入一个单词时,机器人会自动回复一个特定的回复,我会发出一个命令来添加这些东西,但我遇到了一个问题,也就是说,每个参数只得到第一个和第二个输入,我想把它们分开,下面是一个小例子:
@client.command() async def areply(ctx,word, info):
您可以添加*,它将第二个参数后的每个单词作为用户输入,例如:
*
@client.command() async def areply(ctx, word, *, info): await ctx.send(f"The word provided was: `{word}` and the information provided was: `{info}`")
假设用户键入!areply Example This is test info,bot将输出以下内容:
!areply Example This is test info
The word provided was: Example and the information provided was: This is test info
Example
This is test info
您可以添加
*
,它将第二个参数后的每个单词作为用户输入,例如:假设用户键入
!areply Example This is test info
,bot将输出以下内容:相关问题 更多 >
编程相关推荐