mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-23 10:27:49 +00:00
onReplyToMessage example
This commit is contained in:
parent
17cb062c96
commit
d2c0ac6409
17
examples/replyToMessage.js
Normal file
17
examples/replyToMessage.js
Normal 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);
|
||||
});
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user