Botkit: reply buttons with Bot Framework

Created on 20 Sep 2017  路  2Comments  路  Source: howdyai/botkit

I'd like to know if is possible to reply a messagem with buttons using bot framework platform or something similar to builder.Prompts.choice https://docs.microsoft.com/en-us/bot-framework/nodejs/bot-builder-nodejs-dialog-prompt#promptschoice

Microsoft-Bot Framework-related help wanted

Most helpful comment

Yes you can reply to an incoming message with buttons using Botkit + MS Botframwork by sanding suggested actions for example ! like this :

bot.reply(message, { "type": "message", "text": "Are you ready ?", "suggestedActions": { "actions": [ { "type": "imBack", "value": "true", "title": "Yes" }, { "type": "imBack", "value": "false", "title": "Not yet" } ] } });
This code example shows how to send a message that presents two suggested actions (Yes & Not yet) to the user, the slightly difference between this approche and prompts.choice() is in how to manage unwanted options. with prompts.choice() you ask your user to choose from a fixed list of options, so if he type an unwanted value, MS BotBuilder will handle the error for you and ask the user to choose a correct value again and again. However, if you send suggested actions you should manage the unwanted values manually.

All 2 comments

Yes you can reply to an incoming message with buttons using Botkit + MS Botframwork by sanding suggested actions for example ! like this :

bot.reply(message, { "type": "message", "text": "Are you ready ?", "suggestedActions": { "actions": [ { "type": "imBack", "value": "true", "title": "Yes" }, { "type": "imBack", "value": "false", "title": "Not yet" } ] } });
This code example shows how to send a message that presents two suggested actions (Yes & Not yet) to the user, the slightly difference between this approche and prompts.choice() is in how to manage unwanted options. with prompts.choice() you ask your user to choose from a fixed list of options, so if he type an unwanted value, MS BotBuilder will handle the error for you and ask the user to choose a correct value again and again. However, if you send suggested actions you should manage the unwanted values manually.

Thank you man, it works.

Was this page helpful?
0 / 5 - 0 ratings