How to send message to any Facebook Pages with a bot?

202 Views Asked by At

I have created Facebook Messenger bots to answer to people talking to my Facebook Pages with a wrapper of Microsoft Bot Framework.

When a human talk to my bot it has a recipient address (composed of multiple fields) used to reply.

Now I'd like my bot to talk to other Facebook page (like a human using a Messenger client)

Questions:

  • How can I find the "chat" address of a random user that do not already talk to my page/bot ? (It seems a same user has different address when it talk to multiple bots).
  • How can I use my bot to send messages to other's Facebook Page. To do that I assume the bot has to discover the recipient address of the human or bot behind that page ?

(May be the answer is to use an implementation of a Messenger Client in NodeJS ?)

1

There are 1 best solutions below

0
On BEST ANSWER

For Facebook Messenger:

  • User "chat address", that is to say "Id" property of your Recipient, depends on every bot and cannot be guessed (it is a Page Scoped ID), you have to talk to the bot first. It's a question of security / anti-spam

  • Same problem to start a conversation with another page: you cannot guess the ID of the human/bot to which you will be talking to.

So currently it is not possible to do what you are trying to do.

Maybe you should have a look directly to Facebook APIs to see if you can at least do your 2nd point. For the 1st one, I found no way