【问题标题】:How can i make my bot ask a statement, wait for the response of that statement我怎样才能让我的机器人问一个声明,等待该声明的响应
【发布时间】:2016-06-06 09:25:26
【问题描述】:

有什么方法可以让我的机器人问一个问题并让它等待对该特定问题的响应,以便我可以对该特定消息做更多的事情?

【问题讨论】:

  • 是您想要的答案吗?为什么不将其设置为接受的答案或提供反馈。

标签: bots slack-api botkit


【解决方案1】:

是的,botkit 自述文件中有示例。复制粘贴:

controller.hears(['question me'], 'message_received',function(bot,message) {

  // start a conversation to handle this response.
  bot.startConversation(message,function(err,convo) {

    convo.ask('How are you?',function(response,convo) {

      convo.say('Cool, you said: ' + response.text);
      convo.next();
    });
  })
})

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-08-09
    • 2019-11-05
    • 1970-01-01
    • 1970-01-01
    • 2013-02-22
    • 2019-10-30
    • 2017-09-30
    相关资源
    最近更新 更多