jgorset / facebook-messenger

Definitely the best way to make Bots on Facebook Messenger with Ruby
MIT License
962 stars 211 forks source link

Facebook::Messenger::Bot::RecipientNotFound: (#100) No matching user found #62

Closed davidmann4 closed 8 years ago

davidmann4 commented 8 years ago

Hi, I am using your lib for my "quality of life" bot framework - currently switching from https://github.com/netguru/messenger-ruby

to your lib - looks way better and the other one does not accept pull requests & issues.

Currently I have a strange problem with the recipent id's - I use your example code but it seems that it somhow has the wrong id :)

image

any ideas?

davidmann4 commented 8 years ago

haha found the problem - used a wrong page_access_token

ZephiroRB commented 8 years ago

mm I have same problem, and again request page_access_token, but same error.

davidmann4 commented 8 years ago

already solved? check your api keys and subscribe to the right page

gulipad commented 7 years ago

I'm getting the same error. My page is subscribed and I generated a new token. The bot says Hello and then a bit after I get the server error. Any ideas?

davidmann4 commented 7 years ago

do oyu have echon enabled? try to disable it

gulipad commented 7 years ago

All okay now, thanks @davidmann4

GinoChiffi commented 7 years ago

I have tried all of the above and I'm still getting this error: Facebook::Messenger::Bot::RecipientNotFound (Unsupported post request. Object with ID 'me' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api):

Any tips or ideas would be of great help!

davidmann4 commented 7 years ago

interesting - can you post the code you are using?

davidmann4 commented 7 years ago

also echo is disabled in fb settings?

GinoChiffi commented 7 years ago

Echo is disabled, im not ddossing myself ;)

Code is super simple.

require 'facebook/messenger'
include Facebook::Messenger

Facebook::Messenger::Subscriptions.subscribe(access_token: ENV["ACCESS_TOKEN"])

Bot.on :message do |message|
  message.reply(text: 'Hello, human!')
end
Facebook::Messenger::Bot::RecipientNotFound (Unsupported post request. Object with ID 'me' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api):

app/bot/listen.rb:4

Line 4 being my subscription with my page access token.

GinoChiffi commented 7 years ago

Additionally; leaving out the reply and inspecting the message variable gives me a valid message object.

#<Facebook::Messenger::Incoming::Message:0x007fdd2d4a40e0 @messaging={"sender"=>{"id"=>"1349987331712XXX"}, "recipient"=>{"id"=>"1683630555268XXX"}, "timestamp"=>1484149162343, "message"=>{"mid"=>"mid.1484149162343:d5a47f1649", "seq"=>121620, "text"=>"Why wont this work?"}}>

lpradovera commented 7 years ago

I have the same issue with the same sample code, but I get ERROR Facebook::Messenger::Bot::RecipientNotFound: (#100) No matching user found. Any news on that?

sbuffose commented 7 years ago

The version of FB changed to v2.10, try this replacing the PAGE_ACCESS_TOKEN:

curl -X POST "https://graph.facebook.com/v2.10/me/subscribed_apps?access_token=PAGE_ACCESS_TOKEN"

Documentation: https://developers.facebook.com/docs/messenger-platform/guides/setup

thabelo commented 6 years ago

This issue was caused by an invalid PAGE_ACCESS_TOKEN on my side, my mistake was that I recreated the token and they look very similar. Please make sure this token is exactly the same.

tdelam commented 6 years ago

I am not using the Ruby client but I did come across this issue while googling for the same error. I have an AI bot built using nodejs and the page access token was the culprit to my issue as well. Hopefully this helps anyone else having the same cryptic error message. Cheers!

jeetendrahurloll commented 6 years ago

i removed message echoes in events it solved the problem