You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i wanna create a food order bot .
in 3 level i get the name,phone and location . so i need to return listener to next operation in each level.
but when i want listen for phone or location this bot.on('message') is listening yet for name message.
help !
bot.onText(/name/, function onNameEnter(msg) {
var chatId = msg.chat.id;
bot.sendMessage(chatId, 'What's your Name?', opts.enterNameOpts).then(function (sended) {
var chatId = sended.chat.id;
var messageId = sended.message_id;
bot.on('message', function (message) {
// do somthings.
bot.sendMessage(chatId, 'fine.', opts.productOpts);
});
});
});
The text was updated successfully, but these errors were encountered:
The problem is, that bot.sendMessage doesnt return any data, but the Promise itself which should look like this: Promise { _bitField: 0, _fulfillmentHandler0: undefined, _rejectionHandler0: undefined, _progressHandler0: undefined, _promise0: undefined, _receiver0: undefined, _settledValue: undefined }
That is also my problem at the moment, since I need to know my SENT (not sended) message id for later editing.
@mohammadreza2012 What you need is a form-like handler to return name, phone, location repectively at every step. This is currently in the works in tgfancy. You can follow the thread here
i wanna create a food order bot .
in 3 level i get the name,phone and location . so i need to return listener to next operation in each level.
but when i want listen for phone or location this bot.on('message') is listening yet for name message.
help !
The text was updated successfully, but these errors were encountered: