亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何刪除建議命令所需的引號用法

如何刪除建議命令所需的引號用法

守著星空守著你 2023-08-03 16:42:10
我做了一個建議命令,但如果用戶不在他們的句子中添加引號,它只會選擇他們輸入的第一個單詞例如:-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))


查看完整回答
反對 回復 2023-08-03
  • 1 回答
  • 0 關注
  • 110 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號