howdyai / botkit

Botkit is an open source developer tool for building chat bots, apps and custom integrations for major messaging platforms.
MIT License
11.48k stars 2.28k forks source link

Twilio not waiting for reply #1256

Closed dmccrevan closed 6 years ago

dmccrevan commented 6 years ago

Using botkit: 0.6.7

When I created a function to start a conversation with a user like this:

bot.startConversation({
        user: '<number>',
        channel: '<number>',
    }, function(err, convo) {
        if (err){
            console.error('Failed to startConversation with user', error);
        }
        convo.ask(booster.question, function(response, convo){
            answer=response.text.body;
        });
    });
}

I am creating a chat bot using the twilio front end & I am creating conversations with users before they have messaged the bot. The code inside of the call back runs before the user responds. Is there an issue maybe with what triggers the callback if you manually create a conversation?

dmccrevan commented 6 years ago

Fixed by having require_delivery=true in the controller configuration.

dmccrevan commented 6 years ago

Actually...this wasn't the fix. For some reason it started to work.