Answer the question
In order to leave comments, you need to log in
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
You need a list of their id's, well, then you just check for the presence of id in the database
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.
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 questionAsk a Question
731 491 924 answers to any question