facebook-messenger

Facebook Chat bot (PHP webhook) sending multiple replies

本秂侑毒 提交于 2019-12-19 04:40:25
问题 My Facebook chat bot is working but it's sending back multiple messages after my initial message to it. This is my webhook script (i appreciate it's a very rough working example): $challenge = $_REQUEST['hub_challenge']; $verify_token = $_REQUEST['hub_verify_token']; if ($verify_token === 'MY_VERIFICATION_TOKEN') { echo $challenge; } $input = json_decode(file_get_contents('php://input'), true); $sender = $input['entry'][0]['messaging'][0]['sender']['id']; $message = $input['entry'][0][

Facebook messenger API bot : “Typing bubble” “ indicator bubble”

给你一囗甜甜゛ 提交于 2019-12-18 19:06:29
问题 I've created a messenger bot, and some action that I perform can take some time. So in order to make the user wait I would like to display the "Indicator Bubble" (the one you see when the people you talk with are typing): Typing bubble It is not defined in the Messenger API documentation how to do it, but it seems possible has they perform it when you hit "callBack" on their card. How can I simulate this? 回答1: It's now available into the messenger bot API via the Sender Action. You can find

Facebook Messenger API:how to break line in a message

蓝咒 提交于 2019-12-18 04:35:14
问题 In Facebook Messenger chat,we can break a line by press "SHIFT+ENTER". So how to break line by Facebook Graph API(Messenger API). I've seen in a few answers that the Graph API accepts <center></center> instead of <br> and some other parts of their API seem to accept \r\n . Is there currently any way of sending a line break and if there is where it it documented? 回答1: If you are using php, You should be use chr(10) . Its working as like '\n' or '<br>' . Also you can use <center></center> . Its

How to send image from app via messenger?

ε祈祈猫儿з 提交于 2019-12-17 22:28:24
问题 I want to send image from my app via messenger. I was looking on Stack Overflow and I found answer which works for WhatsApp. When I tried to change "com.whatsapp" to "com.facebook.orca", it stops working. Here is my code: public void shareImageMessenger() { Bitmap adv = BitmapFactory.decodeResource(getResources(), R.drawable.koza); Intent share = new Intent(Intent.ACTION_SEND); share.setType("image/jpeg"); ByteArrayOutputStream bytes = new ByteArrayOutputStream(); adv.compress(Bitmap

How to answer back with images in wit.ai?

北城余情 提交于 2019-12-14 02:24:25
问题 I am trying to create a fb_messenger bot using wit.ai.In wit.ai,i can only do answering and question which is only text.But I want to answering back to user by showing images.How to do it?Please guide me. Thank you very much. 回答1: You need to send the image in your Wit action using the messenger Bot: Example if you're using Node js: const actions = { /** * This is used by the "Bot sends" action in Wit * @param sessionId * @param text * @returns {Promise.<T>} */ send({sessionId}, {text}) { //

Passing Facebook Messenger bot webview data to Dialogflow and continuing the conversation

让人想犯罪 __ 提交于 2019-12-13 03:24:48
问题 I am using Dialogflow and Facebook messenger to build a interface that opens a Facebook Messenger webview to allow the user to input data. Once the user inputs the data in the webview I want to: Get this data send to Dialogflow and continue the conversation with the user and ask them a follow up question How can I do this? 回答1: Dialogflow doesn't current listen for Facebook Messenger webview events. Dialogflow supports Facebook Messenger welcome (i.e. when the user opens a chat window to

Facebook Messenger webhook setup, but not triggered

青春壹個敷衍的年華 提交于 2019-12-12 07:09:59
问题 So I'm trying to setup a bot for the new Facebook Messenger API. I'm following the quickstart. I setup the webhook ok, and see it in my webhooks, I called this: https://graph.facebook.com/v2.6/me/subscribed_apps?access_token=%3Ctoken%3E and it did not throw any errors, But when I go to the Page that I generated the access token on, and send a message, it does not call my webhook. I check the httpaccess, and it does not call it. Any way to debug this or any ideas? Also, one thing I'm still

Getting Facebook Messenger to show QnA Follow-Up Prompts in BotFramework v4 using Node.js

橙三吉。 提交于 2019-12-11 16:38:44
问题 I'm trying to figure out how to get Facebook Messenger to show follow-up prompts from QnA Maker using BotFramework v4 and Node.js. I've managed to get the follow-up prompts showing in WebChat: I managed this after following the great advice from Matt Stannett in this thread: How to implement cards in a QnA question which has follow up prompts and uses them in the cards However, when it comes to getting them to appear in Facebook Messenger, I'm really struggling. I was hoping it would be as

Messenger ref parameter is not passed to dialogflow

て烟熏妆下的殇ゞ 提交于 2019-12-11 15:54:24
问题 I'm trying to connect messenger bot and dialogflow. The idea is - when you click on the button, service is redirecting you to the me link (example: http://m.me/2010070995927131?ref=initial_message_with_param) then dialoglflow receives initial_message_with_param as message and fullfilment can generate the response. Sending messages works at all but unfortunately, ref param doesn't. Do you have any ideas why ref param is ignored on Dialogflow side? 回答1: Been few months, but i just came across

Connect multiple Messenger ChatBot on Single Facebook App

痴心易碎 提交于 2019-12-11 15:36:53
问题 I'm managing a Facebook page and Have a Facebook validated Node.js ChatBot on it. It Works fine and now I would like to know how to duplicate this ChatBot on multiple other Facebook pages. A single App, a single ChatBot and multiple Facebook pages linked on it. For doing that, If I understood, I have to : - Collect the page.id : app.post('/webhook', (req, res) => { const data = req.body // Make sure this is a page subscription if (data.object === 'page') { // Iterate over each entry data