Without the help of force_reply
, you'll need to write some custom logic. I've implemented this in my custom bots like so:
- Send question to user
bot.sendMessage()
and remember the ID
- Wait for a message
bot.on('message')
- Check if we're waiting for on a reply from this user
- Reply accordingly
// Create bot
const TelegramBot = require('node-telegram-bot-api');
const bot = new TelegramBot('XXXXXXXX:AAEibBwftjTEKuYd9d2X0ACeyyzTk4DLe60', {
polling: true
});
// List of id's we're waiting for
const wait = [];
// Hardcoded chat id
const chatId = 1234567;
// Ask and add to wait list
bot.sendMessage(chatId, 'What is your name?', { parse_mode: 'HTML' });
wait.push(chatId);
// On message
bot.on('message', (msg) => {
// Check we're waiting on this user
if (wait.includes(msg.chat.id)) {
// Send reply
bot.sendMessage(chatId, 'Your name: ' + msg.text );
// Remove from wait list
wait.splice(wait.indexOf(msg.chat.id), 1);
} else {
// Normal message; notify user
bot.sendMessage(chatId, 'Hi! I\'m not expecting a reply from you! How can I help?');
}
});

Note: This is just an example! The code can be extended to include multiple checks, and possibly states to see what message the user is replying on.