botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

[Facebook] User typing event not coming

Open softwaresicario opened this issue 8 years ago • 7 comments

Bot Info

  • SDK Platform: REST API
  • SDK Version:
  • Active Channels: Skype, Slack, Facebook, Kik
  • Deployment Environment: Azure Bot Service, deployed in Heroku.

Issue Description

I am interested in capturing the event of the user typing in my bot.

Botframework documentation says this is possible: [...] typing Indicates that the user or bot on the other end of the conversation is compiling a response [...]

This answer says Facebook Messenger does not support it (2017).

Perhaps some channels (Slack, Skype...) might support this, others don't (Facebook).

Perhaps I just didn't find the right place in documentation to make it work, if so, any link I can follow?

Is this functionality in the roadmap? If yes, ETA?

Thanks in advance for the support!

softwaresicario avatar Feb 07 '18 17:02 softwaresicario

Hi fcarriedos,

We don't have any control or information on what channels provide or not this functionality. From what I have seen, Facebook doesn't seem to support it and Slack does: https://api.slack.com/events/user_typing

As you mentioned we support the typing activity on both sides but is up to you to dig into the channels' APIs to discover if they also provide this functionality.

You can try to capture this activity in your bot and see what channels allow you to show user typing. However, it doesn't seem to be a consistent feature across different channels and therefore, maybe not the best choice for your bot if you opt to deploy to more than one channel.

What is your motivation for capturing user's typing activity? Maybe we can work around that and find a solution.

Regards, Francisco

FranciscoPonceGomez avatar Feb 09 '18 23:02 FranciscoPonceGomez

Hi Francisco,

Thanks for the response!

Absolutely, this is per channel feature, Facebook does not support it and Slack does.

However, I so far I haven't seen in my logs any isTyping event - even from Slack - along with the other ones (message, ContactRelationUpdate, ConversationUpdate...). Will update my code to warn me in case it happens to come and keep you guys posted.

Tried using directly Slack RTM (no Azure in the middle) and I effectively get the isTyping notification, so. Don't know if Azure uses Slack RTM too (or some other Slack channel), in such case the notification is somehow not arriving.

My impression is that a bot knowing when the user is typing could be of value, as this is another sort of input from the human side and should be available for being taken into consideration. I totally understand this up to the channels to provide it or not, just sharing my opinion.

Thanks again for your support!

softwaresicario avatar Feb 10 '18 16:02 softwaresicario

Update on this particular.

No isTyping event comes at all after testing with some more providers apart from Slack and Facebook:

  • Skype.
  • Kik.

The isTyping is sent correctly (same code) to all the channels above but Slack, 200/OK is the response in all cases though:

Works
--------

2018-02-11T00:59:19.674508+00:00 app[web.1]: sendIsTyping(): sending isTyping to 1609228262486050
2018-02-11T00:59:19.674686+00:00 app[web.1]: sendNonReplyMessage(): {"type":"typing","from":{"name":"howdiditgo","id":"157631501557174"},"conversation":{"name":"useronfacebook","id":"1609228262486050-157631501557174","serviceUrl":"https://facebook.botframework.com","channel":"facebook","group":false},"recipient":{"name":"useronfacebook","id":"1609228262486050"},"serviceUrl":"https://facebook.botframework.com"} to https://facebook.botframework.com/v3/conversations/1609228262486050-157631501557174/activities
2018-02-11T00:59:20.671601+00:00 app[web.1]: sendNonReplayMessage(): HTTP response code 200
2018-02-11T00:59:20.671608+00:00 app[web.1]: ===============================================
2018-02-11T00:59:20.671612+00:00 app[web.1]: Received response from Azure
2018-02-11T00:59:20.671614+00:00 app[web.1]: Status line:
2018-02-11T00:59:20.671766+00:00 app[web.1]: HTTP/1.1 200 OK
2018-02-11T00:59:20.671869+00:00 app[web.1]: The headers:
2018-02-11T00:59:20.671942+00:00 app[web.1]: Cache-Control: no-cache
2018-02-11T00:59:20.672131+00:00 app[web.1]: Pragma: no-cache
2018-02-11T00:59:20.672260+00:00 app[web.1]: Content-Type: application/json; charset=utf-8
2018-02-11T00:59:20.672326+00:00 app[web.1]: Expires: -1
2018-02-11T00:59:20.672587+00:00 app[web.1]: Vary: Accept-Encoding
2018-02-11T00:59:20.672654+00:00 app[web.1]: Server: Microsoft-IIS/10.0
2018-02-11T00:59:20.672763+00:00 app[web.1]: Request-Context: appId=cid-v1:4ca03842-d082-4e2e-b3b4-609aa044a18f
2018-02-11T00:59:20.672827+00:00 app[web.1]: X-Powered-By: ASP.NET
2018-02-11T00:59:20.672940+00:00 app[web.1]: Strict-Transport-Security: max-age=31536000
2018-02-11T00:59:20.673026+00:00 app[web.1]: Date: Sun, 11 Feb 2018 00:59:20 GMT
2018-02-11T00:59:20.673194+00:00 app[web.1]: The body:
2018-02-11T00:59:20.673299+00:00 app[web.1]: {}
2018-02-11T00:59:20.673362+00:00 app[web.1]: ===============================================
2018-02-11T00:59:20.673475+00:00 app[web.1]: sendNonReplyMessage(): message sent howdiditgo - User on Facebook
2018-02-11T00:59:20.673541+00:00 app[web.1]: sendIsTyping(): isTyping sent to 1609228262486050

Does NOT work
----------------------

2018-02-11T01:19:39.611086+00:00 app[web.1]: sendIsTyping(): sending isTyping to U948GNRB6:T954QRP62
2018-02-11T01:19:39.614222+00:00 app[web.1]: sendNonReplyMessage(): {"type":"typing","from":{"name":"omniwithnotifs2","id":"B96HEU0UD:T954QRP62"},"conversation":{"name":"useronslack","id":"B96HEU0UD:T954QRP62:D979KJ6BG","serviceUrl":"https://slack.botframework.com","channel":"slack","group":false},"recipient":{"name":"useronslack","id":"U948GNRB6:T954QRP62"},"serviceUrl":"https://slack.botframework.com"} to https://slack.botframework.com/v3/conversations/B96HEU0UD:T954QRP62:D979KJ6BG/activities
2018-02-11T01:19:40.472244+00:00 app[web.1]: sendNonReplayMessage(): HTTP response code 200
2018-02-11T01:19:40.472307+00:00 app[web.1]: ===============================================
2018-02-11T01:19:40.472349+00:00 app[web.1]: Received response from Azure
2018-02-11T01:19:40.472374+00:00 app[web.1]: Status line:
2018-02-11T01:19:40.472466+00:00 app[web.1]: HTTP/1.1 200 OK
2018-02-11T01:19:40.472498+00:00 app[web.1]: The headers:
2018-02-11T01:19:40.472594+00:00 app[web.1]: Cache-Control: no-cache
2018-02-11T01:19:40.472628+00:00 app[web.1]: Pragma: no-cache
2018-02-11T01:19:40.472637+00:00 app[web.1]: Content-Type: application/json; charset=utf-8
2018-02-11T01:19:40.472737+00:00 app[web.1]: Expires: -1
2018-02-11T01:19:40.472756+00:00 app[web.1]: Vary: Accept-Encoding
2018-02-11T01:19:40.472805+00:00 app[web.1]: Server: Microsoft-IIS/10.0
2018-02-11T01:19:40.472826+00:00 app[web.1]: Request-Context: appId=cid-v1:6814484e-c0d5-40ea-9dba-74ff29ca4f62
2018-02-11T01:19:40.472854+00:00 app[web.1]: X-Powered-By: ASP.NET
2018-02-11T01:19:40.472878+00:00 app[web.1]: Strict-Transport-Security: max-age=31536000
2018-02-11T01:19:40.472907+00:00 app[web.1]: Set-Cookie: ARRAffinity=536560f5105d11a84605c968f3028673a3977bf4bbae1d8b4d66aa788853ff8b;Path=/;HttpOnly;Domain=slack.botframework.com
2018-02-11T01:19:40.472961+00:00 app[web.1]: Date: Sun, 11 Feb 2018 01:19:39 GMT
2018-02-11T01:19:40.477760+00:00 app[web.1]: The body:
2018-02-11T01:19:40.477767+00:00 app[web.1]: {}
2018-02-11T01:19:40.477825+00:00 app[web.1]: ===============================================
2018-02-11T01:19:40.477930+00:00 app[web.1]: sendIsTyping(): isTyping sent to U948GNRB6:T954QRP62

Thanks for the support in advance!

softwaresicario avatar Feb 11 '18 17:02 softwaresicario

Thanks for looking into this fcarriedos!

I agree that knowing when the user is typing could be valuable. Unfortunately, most of the channels don't seem to pay attention to this specific activity.

FranciscoPonceGomez avatar Feb 12 '18 23:02 FranciscoPonceGomez

Absolutely! If channels don't send it, there is nothing Azure can do.

What about sending the isTyping from Azure to Slack? That should work, and actually it does for all channels I tested but Slack. The traces up there show a working (Facebook) and not working (Slack).

I found a work around luckily given the way Slack and Azure integrate, but it forces me to have separate code paths, which is exactly what I hoped Azure to avoid.

Do you agree there is an issue sending isTyping to Slack through Azure?

softwaresicario avatar Feb 13 '18 23:02 softwaresicario

Hi fcarriedos,

Are you still having this problem with Slack?

Francisco

FranciscoPonceGomez avatar Feb 28 '18 23:02 FranciscoPonceGomez

Will retry and come back to you.

softwaresicario avatar Mar 22 '18 15:03 softwaresicario