I would like to make my BOT reply to a specific message like this:
I am using the "reply_to_msg_id" with the ID of the message to replies to, but it doesn't work.
Anyone can help me?
Thanks in advance,
Giacomo
I would like to make my BOT reply to a specific message like this:
I am using the "reply_to_msg_id" with the ID of the message to replies to, but it doesn't work.
Anyone can help me?
Thanks in advance,
Giacomo
bot.onText(/\/start/, (msg, match)=> {
var text = "hi user welcome to bot"
bot.sendMessage(msg.chat.id,text,{reply_to_message_id: msg.message_id})
})
use replay_to_message_id
reply_to_message_id
and that it's not working. Please elaborate on why do you your solution would work.
You need to use reply_to_message_id
and NOT reply_to_msg_id
.
Source: Telegram sendMessage API
bot.on('message', (msg) => {
const { message_id: originalMessageId, from: { username }, chat: { id: chatId } } = msg;
bot.sendMessage(chatId, `welcome ${username}`, {
reply_to_message_id: originalMessageId
});
})