Mon 21 Jul 22:43:21 CEST 2025

This commit is contained in:
sbosse 2025-07-21 23:37:58 +02:00
parent 75809a4410
commit 549bac50cb

View File

@ -0,0 +1,53 @@
var botui = new BotUI('reminder-bot');
botui.message
.bot('Would you like to add a reminder?')
.then(function () {
return botui.action.button({
delay: 1000,
action: [{
text: 'Yep',
value: 'yes'
}, {
text: 'Nope!',
value: 'no'
}]
})
}).then(function (res) {
if(res.value == 'yes') {
showReminderInput();
} else {
botui.message.bot('Okay.');
}
});
var showReminderInput = function () {
botui.message
.bot({
delay: 500,
content: 'Write your reminder below:'
})
.then(function () {
return botui.action.text({
delay: 1000,
action: {
placeholder: 'Buy some milk'
}
})
}).then(function (res) {
botui.message
.bot({
delay: 500,
content: 'reminder added: ' + res.value
});
return botui.action.button({
delay: 1000,
action: [{
icon: 'plus',
text: 'add another',
value: 'yes'
}]
})
}).then(showReminderInput);
}