Botkit: Support for FB postbacks as a conversation response

Created on 18 Jan 2017  Â·  5Comments  Â·  Source: howdyai/botkit

While creating a conversation for Facebook Messenger, after creating a conversation, the response is only catched if the user replies with some text, but a postback does not trigger the conversation reply.

Is this a bug or a future improvement?

controller.hears(['START_CONVERSATION'], 'facebook_postback', (bot, message) => {
  bot.startConversation(message, function(err, convo) {
    convo.ask({
      attachment: {
          type:"template",
          payload:{
            template_type:"generic",
            elements: [{
              title: "Press Yes or No",
              buttons:[{
                type:"postback",
                title:"Yes 😀",
                payload:"SAID_YES"
              },
              {
                type:"postback",
                title:"No 😔",
                payload:"SAID_NO"
              }]
            }]
          }
        }
      }
    }, (response,convo) => {

      // Except to receive either SAID_YES or SAID_NO
      // Only receives "text" (if user writes), no postbacks
      console.log(response)
    })
  })
})
enhancement help wanted

Most helpful comment

receive_via_postback: true is what youre looking for
Goes into your controller like so

var controller = Botkit.facebookbot({
access_token: process.env.access_token,
verify_token: process.env.verify_token,
receive_via_postback: true,
})

Checkout the facebook botkit docs for more
info

On Tue, Jan 24, 2017 at 11:13 AM joekh notifications@github.com wrote:

I am facing the same issue :), any updates on this?

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/howdyai/botkit/issues/604#issuecomment-274850629, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AMUR219fyjFYMX7nz53lqRjnoiYqrGaeks5rViNFgaJpZM4LnYnk
.

All 5 comments

I'm going to patch this by myself

I am facing the same issue :), any updates on this?

receive_via_postback: true is what youre looking for
Goes into your controller like so

var controller = Botkit.facebookbot({
access_token: process.env.access_token,
verify_token: process.env.verify_token,
receive_via_postback: true,
})

Checkout the facebook botkit docs for more
info

On Tue, Jan 24, 2017 at 11:13 AM joekh notifications@github.com wrote:

I am facing the same issue :), any updates on this?

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/howdyai/botkit/issues/604#issuecomment-274850629, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AMUR219fyjFYMX7nz53lqRjnoiYqrGaeks5rViNFgaJpZM4LnYnk
.

in @jonchurch 's defense it worked when he posted it :D I edited his post on his behalf.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GautierT picture GautierT  Â·  3Comments

koubenecn picture koubenecn  Â·  3Comments

matueranet picture matueranet  Â·  4Comments

TheJimFactor picture TheJimFactor  Â·  4Comments

znat picture znat  Â·  4Comments