A
A
AlexAlex2292021-12-04 08:40:15
Bots
AlexAlex229, 2021-12-04 08:40:15

How to find out which groups my telegram bot is added to?

I created a telegram bot, I want to see which groups or channels it was added to. How can i do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
ambal245, 2021-12-12
@AlexAlex229

In the bot, register a function to receive data from my_chat_member, parse and write to the database.

// получаем данные от АПИ и преобразуем их в ассоциативный массив
$data = json_decode(file_get_contents('php://input'), true);
$newChat = $data['my_chat_member']['chat']['title']; // в этой переменной будет лежать название канала или группы

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question