【问题标题】:Discord Bot waiting for multiple user inputDiscord Bot 等待多个用户输入
【发布时间】:2021-02-07 09:31:21
【问题描述】:

好吧,我有一个机器人,它只对一条消息做出反应。

用户发送输入。 机器人发送输出。 命令完成。

但是我希望机器人例如向用户询问一些事情 用户发送输入。 机器人发送问题:“你确定要 XXXXXX” 用户发送 2. 输入。 bot 发送输出。

我不确定如何让机器人在一个命令中等待第二条用户消息。

【问题讨论】:

    标签: python api input command discord


    【解决方案1】:

    你必须在它之前添加一个检查。

    def check(message, user):
      return message.channel == ctx.message.channel and user.author == ctx.message.author
    reply = await bot.wait_for('message', check=check)
    

    像这样。

    【讨论】:

      猜你喜欢
      • 2021-12-07
      • 1970-01-01
      • 1970-01-01
      • 2020-12-26
      • 2018-06-05
      • 2022-01-21
      • 2021-03-31
      • 1970-01-01
      • 2020-10-29
      相关资源
      最近更新 更多