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
2
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
You need to use reply_to_message_id and NOT reply_to_msg_id.
reply_to_message_id
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 }); })
Click here to cancel reply.
2
Answers
})
use replay_to_message_id
You need to use
reply_to_message_id
and NOTreply_to_msg_id
.Source: Telegram sendMessage API