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

Facebook's Authenticating and Message-received events

Open matheus208 opened this issue 10 years ago • 5 comments

Hi,

I'm using this Send to Facebook plugin and, according to Facebook's documentation, it is supposed to send an "Authentication" callback.

How can I listen for this event on my bot? It doesn't come through as a message. And I've tried adding a listener for these events, with no sucess:

['error', 'quit', 'DeleteUserData', 'BotAddedToConversation', 'BotRemovedFromConversation', 'UserAddedToConversation', 'UserRemovedFromConversation', 'EndOfConversation']

Thank you in advance!

matheus208 avatar May 30 '16 20:05 matheus208

Adding Tom... I believe the only webhook we currently intercept is "Message Received" but Tom can verify. At this point you'd probably need to add logic to your bot to handle the "Authentication" callback.

Stevenic avatar May 31 '16 17:05 Stevenic

Okay, I suppose I could do that. However, I don't receive any messages other than type: "Message". Is there another way to listen to these?

matheus208 avatar Jun 02 '16 13:06 matheus208

No @matheus208 you're right. We have to pass these through. We'll take a look.

Stevenic avatar Jun 02 '16 17:06 Stevenic

You should now receive a message for auth, look in the channeldata

tomlm avatar Jun 02 '16 19:06 tomlm

Cheers! That's awesome!

Is there a way this can be added as a separate message type? I am currently catching it through the normal ("Message") flow. Since the payload from Facebook doesn't match any of the regexes for my dialogs, it ends up being treated on the "onDefault" hook.

I'm just afraid that the payload might change and accidentally match with any of the regexes, resulting in odd behaviour.

It would be great if we could register for an "Authentication" message type, like the other ones described here

Thank you once again!

matheus208 avatar Jun 07 '16 14:06 matheus208