howdyai / botkit

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

webex adapter: dialog in thread does not work with "ask" #2195

Closed monzonj closed 2 years ago

monzonj commented 2 years ago

In webex, it is possible to start conversations in threads. For the most part, it works fine with startConversationInThread however commands such as ask or addQuestion do not capture the answers

For instance, this case:

    const MY_DIALOG_ID = 'my-dialog-name-constant';
    const convo = new BotkitConversation(MY_DIALOG_ID, controller);
    convo.ask('What is your name?', async(response, convo, bot) => {
        console.log(`user name is ${ response }`);
    }, 'name');
    controller.addDialog(convo);

    controller.hears('yo', 'message', async(bot, message) => {
        await bot.startConversationInThread(message.channel, message.user, message.id);
        await bot.beginDialog(MY_DIALOG_ID);
    });

The conversation should go like this (imagine that the bot name is "mybot")

me: @mybot yo
         (threat starts)
         mybot: What is your name?
         me: @mybot Joe
         (conversation ends. NOTHING is logged in the console)

However, if I omit the startConversationInThread all works as expected (just not in a threat)

monzonj commented 2 years ago

I've created a PR with the fix: https://github.com/howdyai/botkit/pull/2198

benbrown commented 2 years ago

PR merged and published.