I have a simple chat-bot writed with aiogram for receiving messages from users and answering to them. I want to make sure that user is subscribed to a particular channel before he can use my bot. How can I implement that?
Asked
Active
Viewed 1,572 times
2
-
1Please provide enough code so others can better understand or reproduce the problem. – Community May 31 '22 at 12:31
1 Answers
2
Use getChatMember method and then check status
field of the ChatMember

Oleg
- 523
- 2
- 10
-
1thanks, I did like that: `check_member = await bot.get_chat_member(-1214166516038, message.from_user.id)` `if check_member.status not in ["member", "creator"]:` `return await message.reply("some text", reply_markup=builderz.as_markup())` – Kevin May 31 '22 at 14:13