2

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?

Kevin
  • 23
  • 5

1 Answers1

2

Use getChatMember method and then check status field of the ChatMember

Oleg
  • 523
  • 2
  • 10
  • 1
    thanks, 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