【问题标题】:discordpy suggestion command不和谐的建议命令
【发布时间】:2021-06-09 05:02:37
【问题描述】:

我的代码:

@client.command()
async def suggest(ctx, suggestion):
    embed = discord.Embed(
        title = "New suggestion.",
        description = f"{suggestion}",
        color = 0,
        timestamp = ctx.message.created_at
    )
    embed.set_footer(text='Requested by {} | ID-{}' .format(ctx.message.author, ctx.message.author.id))

    await ctx.guild.owner.send(embed=embed)
    await ctx.send("Suggestion sent to server owner.")

这个命令的问题是机器人不会读取整个消息,它只读取它的第一个单词。 例如,我发送此消息:=suggest this is suggestion 并且 bot 仅使用第一个单词向所有者发送嵌入,在这种情况下,它将仅发送带有 this 的嵌入,而不是整个句子。如果可以,怎么做?

【问题讨论】:

    标签: python python-3.x discord.py


    【解决方案1】:

    您可以传递仅限关键字的参数

    async def suggest(ctx, *, suggestion):
    

    看看introduction

    【讨论】:

      猜你喜欢
      • 2020-11-22
      • 1970-01-01
      • 2018-11-10
      • 2021-07-04
      • 2021-12-28
      • 2020-07-13
      • 2020-09-26
      • 2021-10-05
      • 2021-06-30
      相关资源
      最近更新 更多