A
A
Arbitr2021-07-04 23:39:02
Node.js
Arbitr, 2021-07-04 23:39:02

How to see who replied to a bot message?

There is a bot. The client writes a problem to the bot. The bot forwards this problem to the group chat. A group chat participant responds to a bot message with the phrase take. The bot takes the nickname of the user (who responded with take) and sends his data to the client.
The problem is that it is not possible to read messages from a group chat. Trite, how to take the id of a group chat in order to send and read messages from it?
Then how to read messages from a group? As I understand it, you need to receive updates using getUpdates, but again I don’t understand how to use it.
I looked at the forums and found something like this:

const {Telegraf} = require('telegraf');
const config = require('config')

const bot = new Telegraf(config.get('token'));

bot.telegram.getMe().then((botInfo) => {
    bot.options.username = botInfo.username;
    bot.command('/help', ctx => ctx.reply('help'));

})

bot.launch();

But it doesn't work. I set the privacy settings, gave the admin panel, added the bot on a new one, it didn’t work.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question