How to find out the chat_id of a forwarded message?

  • 0
    a person writes to a bot that forwards a message to me.

    bot.on ('message', msg = & gt; {
    const chatId = msg.chat.id
    const myChat = '123456789'
    if (msg.chat.id! == myChat) {
    bot.forwardMessage (myChat, chatId, msg.message_id)
    }
    })
    how do i get the chat_id from which the message was sent
    JavaScript Anonymous, Mar 2, 2019

  • 1 Answers
  • 0
    return chatId
    Evangeline Webb

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!