'bot.telegram.getChat does not return the message of a specific user

I am trying to setup my bot so that it will 'listen' to a specific user and print out any incoming message.

I have already setup a bot in telegram using BotFather. This is what I have so far

const { Telegraf } = require('telegraf')
const bot = new Telegraf('my_bot_token_here');

bot.telegram.getChat(Chat_Id).then(function(chat) {
  console.log('chat info', chat);
});

The object does not contain the user message.

Any advice on this is appreciated.



Solution 1:[1]

Yes, absolutely. You need to check the 'from' field in the message before executing your logic.

Telegram API

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 JackHacks