mullwar / telebot

The easy way to write Telegram bots in Node.js
https://www.npmjs.com/package/telebot
MIT License
1.48k stars 270 forks source link

askPlugin not work. Please, Any Help #165

Open MorganaUzhgorod opened 5 years ago

MorganaUzhgorod commented 5 years ago

ask Plugin just send message at the same time with parent command. I use it with namedButtons plugin. (usePlugins: ['namedButtons', 'askUser'])

See screenshots

Снимок экрана 2019-08-20 в 16 53 57

Снимок экрана 2019-08-20 в 16 49 25

cikaldev commented 3 years ago

just remove the curly braces {} on your last bot response,

bot.on('/test', msg => {
  const id = msg.from.id;
  return bot.sendMessage(id, 'test run, now reply me anything.', {ask: 'waiting'});
});

bot.on('ask.waiting', msg => {
  const id = msg.from.id;
  const txt = msg.text;
  return bot.sendMessage(id, `Your reply is ${txt}`);
});