weixin_39577964
2020-11-28 21:55 阅读 0

How to make bot reply to certain question and reply publicly.

Right now the bot has to be spoken in order for it o reply. I'm thinking of doing some simple stuff. For example, if somebody shout morning in the Slack channel. I want the bot to reply to that person with out spoken to.

Is there a way to do that now?

Thanks

该提问来源于开源项目:superscriptjs/superscript

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

8条回答 默认 最新

  • weixin_39617473 weixin_39617473 2020-11-28 21:55

    So, this actually sounds like 2 issues, lets flush it out a little more, and no issues at the same time.

    If someone says morning -> the bot replies good morning... That should be possible now as it is still request / reply. 1. When someone replies morning send a DM to the user in slack For this to work, we need to make some assumptions about how the conversation model is setup, is it one-on-one, or is it a group chat, or some hybrid. The bot currently knows the user who sent the message, and the slack client could map that back to the user and simply DM him/her. This is how I would solve this right now. Having said that, there may be some improvements made in the bot engine. For example, in a group chat mode, perhaps we can have a listen flag or chat velocity setting, or moderator mode. Which dictate how the bot will participate in the conversation. (Right now, it tries to reply to everything) 2. Send a message to a user without first being initiated. This was something I had in the first prototype and removed only because it needed to be flushed out more. It boils down to 2 components. a. The bot needs to be able to see who is online and available to chat with.
    b. The bot needs some rules about how it can speak out. ie: after 5 seconds of no activity, missed volley, topic change, user login event. We will finally need an API that supports these types of rules.

    Happy to chat more about this, as I think they are both amazing features.

    点赞 评论 复制链接分享
  • weixin_39730284 weixin_39730284 2020-11-28 21:55

    when you have time can you add more details on this? if you decide to build additional things based on this, maybe add them as new issues :-)

    点赞 评论 复制链接分享
  • weixin_39861624 weixin_39861624 2020-11-28 21:55

    +1 for 2b above (the ability to send a message to a user without first being initiated). I'm building a text service that responds to user chat and also needs to send messages independent of user input based on other triggers resulting from non-chat triggers. Are there any examples or recommended approaches for being able to do that in the interim?

    点赞 评论 复制链接分享
  • weixin_39730284 weixin_39730284 2020-11-28 21:55

    we are using this approach #155. The __open__ is sent to the bot but not to the UI. My colleague could tell you more if you have more specific questions.

    点赞 评论 复制链接分享
  • weixin_39861624 weixin_39861624 2020-11-28 21:55

    To be more clear - my intent is to have the bot 'reply' to a user based on an event external to the conversation. In the case that you referenced are you passing an event to the bot as if it were a user message that can then be handled by the bot normally?

    点赞 评论 复制链接分享
  • weixin_39617473 weixin_39617473 2020-11-28 21:55

    Can you provide an example of what that external event might be?

    点赞 评论 复制链接分享
  • weixin_39861624 weixin_39861624 2020-11-28 21:55

    User A asks bot a question

    Bot asks 10 other users the same question (this could be a function)

    When the bot has 3 answers it sends the answers to user A (this is the external event).

    On Thu, Oct 29, 2015 at 1:11 AM, Rob Ellis notifications.com wrote:

    Can you provide an example of what that external event might be?

    Reply to this email directly or view it on GitHub: https://github.com/silentrob/superscript/issues/107#issuecomment-152077117

    点赞 评论 复制链接分享
  • weixin_39617473 weixin_39617473 2020-11-28 21:55

    okay that is great. I have made something simular work with how the system works today. My use case was User A asks bot a question Bot pipes question to private slack channel, and when an answer comes back we send it back to the user.

    Because the system is async this can work today... and because you are in the plugin (function) you have the user context so you can reply at any time and hold the connection. However if you want to reply with something generic like, "Let me think about that..." and then reply minutes later to the user, that is a little different and might need a little work before that can work.

    In my example I waited 30 seconds and then replied with something generic like "Im not sure..."

    Keep in mind this is still not a fully blind initial contact. Ie: The bot initiats the very first contact with the user. Which is a little more complicated becasue the system would need to know the user has connected which, and right now the connection and initial message are really the same thing.

    点赞 评论 复制链接分享

相关推荐