skip to Main Content

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

2

Answers


  1. 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

    Login or Signup to reply.
  2. 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
      });
    })
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search