2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-23 02:17:16 +00:00

onReplyToMessage example

This commit is contained in:
Yago 2016-01-30 18:02:24 +01:00
parent 17cb062c96
commit d2c0ac6409

View File

@ -0,0 +1,17 @@
'use strict';
var TelegramBot = require('node-telegram-bot-api');
var TOKEN = 'BOT_TOKEN';
var USER = 'USER_ID';
var bot = new TelegramBot(TOKEN, {polling: {timeout: 1, interval: 100}});
bot.sendMessage(USER, 'How old are you?')
.then(function (sended) {
var chatId = sended.chat.id;
var messageId = sended.message_id;
bot.onReplyToMessage(chatId, messageId, function (message) {
console.log('User is %s years old', message.text);
});
});