Charca / bootbot

Facebook Messenger Bot Framework for Node.js
MIT License
974 stars 253 forks source link

Parameter error: You cannot send messages to this id #135

Open ihavenonickname opened 6 years ago

ihavenonickname commented 6 years ago

This call:

bot.say(user_id, "hello")

Results in the following error:

(Messenger Error received. For more information about error codes, see: https://goo.gl/d76uvB
{ message: '(#100) Parameter error: You cannot send messages to this id',
  type: 'OAuthException',
  code: 100,
  fbtrace_id: 'EiRBnjXA1uA' })

The user_id parameter is the payload.sender.id from bot.on('message') callback.

What bugs me is that it works on my local machine, however it doesn't on my remote server, even using the very same user_id in both machines.

Any hints?

mraaroncruz commented 6 years ago

Check your app ID and page token. Make sure they're not null and correct for the correct page.

ihavenonickname commented 6 years ago

Hello!

I checked, they're equal on both machines.

Just to be clear, bot.on('message') works on both machines, while bot.say only works on one of them (my local machine).

mraaroncruz commented 6 years ago

It sounds like a facebook page token issue. Are you sure that the page tokens match the app you are expecting to use?

User ID's are page scoped so this sounds like you are trying to send to a user that is connected to a different page. So FB's like "Who is this?"

I can almost guarantee that your facebook page token is incorrect.

mraaroncruz commented 6 years ago