mvaragnat / botkit-messenger-express-demo

Demo of running BotKit for Facebook Messenger on an Express server with MongoDB storage
42 stars 20 forks source link

not getting any result while using conversation ? #10

Closed deepakmhr closed 7 years ago

deepakmhr commented 7 years ago

Simple here is working fine but when I am using conversation not getting any attachment response on messenger.

This is what I was trying

    controller.hears(["location"], "message_received", function(bot, message) {

        bot.startConversation(message, function(err, convo) {

            convo.ask({
                text: "Where are you honey?",
                quick_replies: [{
                    "content_type": "location",
                }]
            }, function(response, convo) {
                if (response.attachments[0].type == "location") {
                    coordinates = response.attachments[0].payload.coordinates;
                    //responseStore.toDatabase('Location', coordinates, response);
                    convo.say("got it, latitude" + response.attachments[0].payload.coordinates.lat + "and longitude" + response.attachments[0].payload.coordinates.lat);
                    //aTopic(response, convo);
                } else {
                    convo.say("no no no");
                    //anotherTopic(response, convo);
                }
                convo.next();
            });
        });
    }); 

I am doing anything wrong ?

or can you please suggest some of the best solutions for using custom express server with botkit framework?

mvaragnat commented 7 years ago

I've submitted a PR to Botkit to include location type. I think this demo should use a more recent version of Botkit - can you try to upgrade Botkit and see if it solves your problem ? And perhaps submit a PR if it does :-)

mvaragnat commented 7 years ago

Hey folks,

Just to let you know that 1) I'm not actively maintaining that repo anymore 2) Since Botkit, Slack API, FB API evolve very quickly, there is a high probability of obsolescence of some parts of the code.

=> If you find a solution to your issue, please consider a PR! I'll happily merge it. This repo is aimed at helping beginners, so let's make it better