我做了一個建議命令,但如果用戶不在他們的句子中添加引號,它只會選擇他們輸入的第一個單詞例如:-suggest this is a test。 它只會選擇“這個”對此有任何修復嗎?命令代碼行:@client.command()async def suggest(ctx, suggestion): channel = client.get_channel(754640430670413835) embed = discord.Embed(color=0xff0000) embed.add_field(name="SUGGESTION", value="{} suggested this: ** {} **".format(ctx.author.mention, suggestion), inline=False) await channel.send(embed=embed) await ctx.send("Thank you for your suggestion {}".format(ctx.author.mention))
1 回答

慕沐林林
TA貢獻2016條經驗 獲得超9個贊
您可以要求圖書館將其余部分作為單個參數提供給您。我們通過使用僅關鍵字參數來做到這一點。在您的參數*之前添加一個。suggestion
@client.command()
async def suggest(ctx, *, suggestion):
channel = client.get_channel(754640430670413835)
embed = discord.Embed(color=0xff0000)
embed.add_field(name="SUGGESTION", value="{} suggested this: ** {} **".format(ctx.author.mention, suggestion), inline=False)
await channel.send(embed=embed)
await ctx.send("Thank you for your suggestion {}".format(ctx.author.mention))
添加回答
舉報
0/150
提交
取消