Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop/interupt askUser Plugin #215

Open
noerarief23 opened this issue Nov 10, 2021 · 0 comments
Open

stop/interupt askUser Plugin #215

noerarief23 opened this issue Nov 10, 2021 · 0 comments

Comments

@noerarief23
Copy link

noerarief23 commented Nov 10, 2021

bot.on('/start', msg => {
const id = msg.from.id;
// Ask user name
return bot.sendMessage(id, 'What is your name?', {ask: 'name'});
});
// Ask name event
bot.on('ask.name', msg => {
const id = msg.from.id;
const name = msg.text;
// Ask user age
return bot.sendMessage(id, Nice to meet you, ${ name }! How old are you?, {ask: 'age'});
});

if send /cancel or another command, how to stop/interupt askUser ?
to hide/stop this message "Nice to meet you, /cancel ! How old are you?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant