Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update messenger engine to facebook's new format #163

Closed
wants to merge 1 commit into from
Closed

Update messenger engine to facebook's new format #163

wants to merge 1 commit into from

Conversation

romulocollopy
Copy link

@romulocollopy romulocollopy commented May 4, 2018

  // Get the webhook event. entry.messaging is an array, but
  // will only ever contain one event, so we get index 0

como descrito em https://messenger.fb.com/developers/resources/quickstart/

Closes: #164

      // Get the webhook event. entry.messaging is an array, but
      // will only ever contain one event, so we get index 0

como descrito em https://messenger.fb.com/developers/resources/quickstart/
@rougeth
Copy link
Owner

rougeth commented May 9, 2018

@romulocollopy cara, acho que essa alteração quebra a integração com o Messenger. Você chegou a testar ai? Na documentação diz que o json abaixo chega pelo webhook:

{
  "object":"page",
  "entry":[
    {
      "id":"<PAGE_ID>",
      "time":1458692752478,
      "messaging":[
        {
          "sender":{
            "id":"<PSID>"
          },
          "recipient":{
            "id":"<PAGE_ID>"
          },
          # ...
        }
      ]
    }
  ]
}

O entry é uma lista de dados de eventos. Cada item do entry tem um messaging que de fato é uma lista de um item só. Nesse caso, acho que a mudança seria assim (não testei):

updates = [self.message_handler(entry['messaging'][0]) for entry in content['entry']]

Reference: https://developers.facebook.com/docs/messenger-platform/reference/webhook-events


I took the liberty to update your PR description :)

@desireemenezes
Copy link

.

@romulocollopy romulocollopy closed this by deleting the head repository May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Messenger considering wrong payload from Facebook webhook
3 participants