When subscribing to certain channels, administrator approval is required. These channels use hidden links and do not have any usernames. After requesting to join, I am being asked questions by a bot to verify if I am a real user. I have been encountering this frequently lately. How can I achieve this using python-telegram-bot? Just explaining the logic would be sufficient. I am familiar with coding. Any hints would be helpful.
Question posted in Telegram API
A comprehensive official documentation can be found here.
A comprehensive official documentation can be found here.
2
Answers
If your bot has the required permissions in the chat in question, it will receive
chat_join_request
updates when a user requests to join. In PTB you can catch those with theChatJoinRequestHandler
. Your bot can then send (a single!) message to the user and if the user replies, it can also send more messages. Finally, your bot can approve or reject the request.Disclaimer: I’m currently the maintainer of
python-telelegram-bot
.As @callmestag explained above. Here is the piece of code(in pyTelegramBotApi library)