0

I would like to make my BOT reply to a specific message like this:

enter image description here

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

3
  • What does it say when you send the request with reply_to_msg_id? It should return an error if it doesn't work.
    – Ali Padida
    Mar 25, 2020 at 20:45
  • Hi, no it doesn't.
    – JackPolets
    Mar 26, 2020 at 16:38
  • Then use another API for your bot development, it should always return a response for you to find out about the error.
    – Ali Padida
    Mar 26, 2020 at 16:49

2 Answers 2

0
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

1
  • 1
    OP has already mentioned that he's using reply_to_message_id and that it's not working. Please elaborate on why do you your solution would work.
    – Gangula
    Sep 24, 2021 at 18:50
0

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
  });
})

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.