twiliochatbotbotkit

botkit- Twilio-sms not waiting for reply


`

controller.webserver.get('/test', async function (req, res, next) {
        // console.log(req.params.id)
        let bot = await controller.spawn();
        await bot.startConversationWithUser(process.env.GOOGLE_NUMBER);
        // console.log(bot);
        await bot.beginDialog('workflow_id');
        res.send({data: 'special'});
    });

`

Added convo dialog like this `

const MY_CONVO = 'workflow_id';
    let convo = new BotkitConversation(MY_CONVO, controller);
    convo.ask('What is your name?',[], {key: 'name'});
    convo.ask('What is your age?', [], 'age');
    convo.ask('What is your favorite color?', [], 'color');
    convo.after(async (results, bot) => {

        // handle results.name, results.age, results.color
        console.log(results.name + results.age + results.color);

    });
    controller.addDialog(convo);

` same added dialog code is working fine when I'm starting conversations with like below just sending SMS to bot number *workflow *.

`

controller.hears('workflow', 'message', async (bot, message) => {
        await bot.beginDialog('workflow_id');
    });

`

Please help us thanks in advance.


Solution

  • I've solved this issue. I put wrong credentials in .env file so.