S
S
Sasha3455342020-10-09 08:43:29
Telegram
Sasha345534, 2020-10-09 08:43:29

How to give access to the telegram bot only to those users who are members of the group?

Hello, I have a php bot.
Tell me what needs to be done so that only those who are members of the telegram group have access to the bot, respectively, if the user left the group, access is taken

Answer the question

In order to leave comments, you need to log in

4 answer(s)
L
Leo Mavrin, 2020-10-09
@Leo5878

You need a list of their id's, well, then you just check for the presence of id in the database

D
Danny Arty, 2020-10-09
@DanArst

To determine the sender use message.from.id
Use the getChatMember method to get the user id.
And just compare. If not, then deny access.

A
Artem Pyvovar, 2020-10-09
@art9mid

You need "user_id": 14124122,
create a condition, on ===

H
hesy, 2020-10-09
@hesy

You add your bot to the group, when the user subscribes / unsubscribes to the channel, you catch the event and enter it in the database or delete it.
In the bot itself, you check if the user is in the database, then he is signed, if he is not there, then he is not signed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question