messenger-bot-tutorial icon indicating copy to clipboard operation
messenger-bot-tutorial copied to clipboard

When i send the word Generic nothing happens

Open mitchelsneddon opened this issue 8 years ago • 4 comments

Cloned the tutorial and everythings working apart from when you send a message of "Generic" it does nothing, it shows the message has been read but the app doesn't respond with the postback

mitchelsneddon avatar Mar 31 '17 14:03 mitchelsneddon

You have to modify the initial app.post. Otherwise it just follows the first rule and never gets to the updated rule which specifies the response to 'Generic'

victorwho avatar Apr 10 '17 04:04 victorwho

Hi Victor,

I have attached a screenshot of the section you mention. What code do I need to put in on line 43 (A guess)?

screen shot 2017-05-20 at 22 45 51

Would appreciate any help I can get on this one. Almost there now, got the text reply, just need to get the cards. :)

ghost avatar May 20 '17 21:05 ghost

screen shot 2017-05-31 at 17 42 06

You need to modify app.post() to call the sendGenericMessage() function if the incoming message is 'Generic'

I'm assuming that you already added the sendGenericMessage() function to your index.js file

dchege711 avatar May 31 '17 14:05 dchege711

Hi @dchege711 ,

It transpired that I had already added that code in at the bottom. I moved that up an replaced it with the older code. I had managed to get it working!

Thank you so much for your help.

As a side question, what is the function of the Postback button? Facebooks description helped a little, but does not provide much in the way of context: https://developers.facebook.com/docs/messenger-platform/webhook-reference/postback

Is it saying that when I press Test button, that is the same as my pressing of Postback on the card?

ghost avatar Jun 01 '17 12:06 ghost