diff --git a/messenger.go b/messenger.go index 9c01515..25deed2 100644 --- a/messenger.go +++ b/messenger.go @@ -288,8 +288,8 @@ func (m *Messenger) handle(w http.ResponseWriter, r *http.Request) { return } - if rec.Object != "page" { - fmt.Println("Object is not page, undefined behaviour. Got", rec.Object) + if rec.Object != "page" && rec.Object != "instagram" { + fmt.Println("Object is not page or instagram, undefined behaviour. Got", rec.Object) respond(w, http.StatusUnprocessableEntity) return } diff --git a/response.go b/response.go index 98cca80..015494b 100644 --- a/response.go +++ b/response.go @@ -25,9 +25,9 @@ type SenderAction string const ( // SendMessageURL is API endpoint for sending messages. - SendMessageURL = "https://graph.facebook.com/v2.11/me/messages" + SendMessageURL = "https://graph.facebook.com/v11.0/me/messages" // ThreadControlURL is the API endpoint for passing thread control. - ThreadControlURL = "https://graph.facebook.com/v2.6/me/pass_thread_control" + ThreadControlURL = "https://graph.facebook.com/v11.0/me/pass_thread_control" // InboxPageID is managed by facebook for secondary pass to inbox features: https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control InboxPageID = 263902037430900