mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-09-02 15:25:28 +00:00
onReplyToMessage example
This commit is contained in:
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);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user