broidHQ / integrations

Connect your App to Multiple Messaging Channels with the W3C Open standard.
https://www.broid.ai
GNU Affero General Public License v3.0
746 stars 83 forks source link

Facebook Messenger Activity & Buttons template #196

Closed killix closed 6 years ago

killix commented 6 years ago

Quick Reply & Simple message buttons

The idea is to add the support of buttons with simple message

screen shot 2017-09-28 at 1 38 24 pm

To do that, we need to identify the kind of Link (older Buttons) in AS2 send by the developers. I added the notion of new mediaType 'text/plain' to identify the quick reply behavior.

If it's accepted, we need to update all integrations with this new way and publish as breaking change.

Sender Actions

This PR added also the support of sender actions

Turn typing indicators on can be done with new Activity Object:

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Create",
  "generator": {
    "id": "f6e92eb6-f69e-4eae-8158-06613461cf3a",
    "type": "Service",
    "name": "messenger"
  },
  "object": {
    "type": "Activity",
    "content": "typing/on",
  },
  "to": {
    "type": "Person",
    "id": "1396343657196792"
  }
}