Skip to content

Commit

Permalink
Go from dialog to dialog => fails
Browse files Browse the repository at this point in the history
  • Loading branch information
cooperka committed Oct 16, 2019
1 parent b95aef3 commit 8c94c5e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion features/sample_hears.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function initDialog(controller) {
{
pattern: /yes|yeah|ya|yep|y|right|correct/,
handler: async (response, convo, bot) => {
await convo.gotoThread(CONCLUSION);
await bot.beginDialog('ONBOARDING_DIALOG_2');
},
},
{
Expand Down
20 changes: 10 additions & 10 deletions features/sample_hears2.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const { BotkitConversation } = require('botkit');

const ONBOARDING_DIALOG = 'ONBOARDING_DIALOG';
const ONBOARDING_DIALOG = 'ONBOARDING_DIALOG_2';

module.exports = function(controller) {

initDialog(controller);

controller.hears(['hi', 'hello', 'hey'], 'message', async (bot) => {
await bot.beginDialog(ONBOARDING_DIALOG);
});
// controller.hears(['hi', 'hello', 'hey'], 'message', async (bot) => {
// await bot.beginDialog(ONBOARDING_DIALOG);
// });

}

Expand All @@ -22,15 +22,15 @@ function initDialog(controller) {
controller,
);

dialog.say('onboarding.welcome');
dialog.say('onboarding2.welcome');

dialog.addAction(GET_DETAILS_THREAD);

dialog.addMessage('onboarding.startOver', REPEAT_DETAILS_THREAD);
dialog.addMessage('onboarding2.startOver', REPEAT_DETAILS_THREAD);
dialog.addAction(GET_DETAILS_THREAD, REPEAT_DETAILS_THREAD);

dialog.addQuestion(
'onboarding.askName',
'onboarding2.askName',
[
{
default: true,
Expand All @@ -44,12 +44,12 @@ function initDialog(controller) {
);

dialog.addQuestion(
'onboarding.confirmation',
'onboarding2.confirmation',
[
{
pattern: /yes|yeah|ya|yep|y|right|correct/,
handler: async (response, convo, bot) => {
await convo.gotoThread(CONCLUSION);
await bot.beginDialog('ONBOARDING_DIALOG');
},
},
{
Expand All @@ -63,7 +63,7 @@ function initDialog(controller) {
GET_DETAILS_THREAD,
);

dialog.addMessage('onboarding.success', CONCLUSION);
dialog.addMessage('onboarding2.success', CONCLUSION);

controller.addDialog(dialog);
}

0 comments on commit 8c94c5e

Please sign in to comment.