Facebook Messenger Bot cannot send message to a given ID not working - facebook-messenger

I want to send message to a user any time using facebook messenger API.
I'm using developer version of messaging app and has not submitted for review yet.
We are two friends both as developer in the app. I want when my friend sends message to my page, Bot replies and a copy of message sent by friend comes to my inbox. But when I tried api throws following error.
{"error":{"message":"(#100) Parameter error: You cannot send messages to this id","type":"OAuthException","code":100,"fbtrace_id":"HRTLdvidA4u"}}
Is there any solution.
Thanks.

Related

does watson assistant know if there is null response from user?

I have created a chatbot in Watson assistant and I need a condition where if there the user goes silent for 10 seconds I continue the conversation. is there a way for Watson to know if there is no response (null response)?
Also, does Watson know if the user clicked on a link? is clicking on a link considered a response in Watson?
Watson Assistant does not know if a user hasn't sent back a response,
you can do one of the following:
if you are using WA web chat channel, use the events provided to control the flow. You can set a timer via pre:recieve and reset it if the user did send a message via pre:send.
if there is a timeout send a message via send operation.
Alternatively, if you plan on supporting more than just a web chat channel (e.g. facebook, phone, whatsapp, etc.), you are better off implementing the same logic in a Post Message webhook and . Essentially, make your code keep a timer in the Post message and if a user send a reply, turn the timer off in a Pre Message webhook

Is it possible to send me a Discord private message when an user confirm a form sending in my website?

I would like to be able to get Discord private message when an user wants to send me a message through my personal website. There is a form inside my website, how can I do this on the onClick button "Send" ?
Look into WebSockets. SocketIO has the most support and documentation however for this simple task you can get away with implementing this using the ws package in nodejs.
Make sure the Discord Bot is the Server & the frontend is the Client.
https://www.npmjs.com/package/ws
https://socket.io/docs/v4/server-api/

Last Message Sent by User Messenger Bot

I'm working with Facebook Messenger Bots and I need a way to make an HTTP Request for the last message sent by the user. All I can find is that Messenger Bots send a web hook with the information but, I specifically need to be able to manually check for the last message sent by the user. Any input would be helpful. Thank you.

Facebook Messenger bot not posting to webhook

I have been building a Facebook Messenger bot and am having trouble receiving messages from Messenger at the webhook on my server. I've been working with the Send API & Webhooks for several weeks and have had no trouble sending messages back and forth to a user until today. I am able to validate the webhook from the Facebook Developer Console, and I can see the validation coming through on a GET call to my /webhook route. However, when I message my bot (which should POST to /webhook) from my personal account, I don't see any of the message data being forwarded to my server. The route never gets hit. The page I'm sending to is subscribed to the app in the Facebook Developer Console. What's strange is that I can manually hit /webhook with a message using curl:
curl -i -X POST -H 'Content-Type: application/json' -d
'{"object":"page","entry":
[{"id":43674671559,"time":1460620433256,"messaging":[{"sender":
{"id":MY_ACTUAL_FACEBOOK_USER_ID},"recipient":
{"id":MY_PAGE_ID},"timestamp":1460620433123,"message":{"mid":"mid.1460620432888:f8e3412003d2d1cd93","seq":12604,"text":"Testing
Chat Bot .."}}]}]}' "https://XXXXX.ngrok.io/webhook"
I'm using ngrok to forward calls to my localhost. The above curl command works fine, meaning I can see the message delivered on my server at /webhook. To me this suggests the problem is coming from Facebook, which would mean it's out of my control. Is there anything I've missed? What else could I check, and why would this be failing silently?
The problem as described above is most likely in Messenger -> settings -> webhooks window where in the bottom you have to select a Page to subscribe to the application (webhook).
Also, sometimes if you send messages and the webhook is offline, it takes couple of minutes for all the messages to come through.

Strange message from facebook messenger api

For some reason I receive message from facebook page (with connected bot):
"Thanks for messaging us. We try to be as responsive as possible. We'll get back to you soon."
But in bot app there is no such phrase.
Whether he can send a facebook message under some conditions (such as long response from webhook)?
I'm guesssing it's an old auto response setting for that page.
Go into settings and under Response Assistant, set both of these to No:
Stay responsive when you can't get to your computer or phone
Send Instant Replies to anyone who messages your Page

Resources