async def is_user_in_chat(chat_id: int, user_id: int): status = False async for user in client.iter_participants(chat_id): if user_id == user.id: status = True break return status
async def is_administrator(user_id: int, message): admin = False async for user in client.iter_participants( message.chat_id, filter=ChannelParticipantsAdmins): if user_id == user.id or user_id in SUDO_USERS or user_id in DEV_USERS: admin = True break return admin
async def is_user_admin(user_id: int, chat_id): status = False async for user in client.iter_participants(chat_id, filter=ChannelParticipantsAdmins): if user_id == user.id or user_id in SUDO_USERS: status = True break return status
async def haruka_is_admin(chat_id: int): status = False haruka = await client.get_me() async for user in client.iter_participants(chat_id, filter=ChannelParticipantsAdmins): if haruka.id == user.id: status = True break return status
async def user_is_ban_protected(user_id: int, message): status = False if message.is_private or user_id in (WHITELIST_USERS + SUDO_USERS): return True async for user in client.iter_participants(message.chat_id, filter=ChannelParticipantsAdmins): if user_id == user.id: status = True break return status
async def user_is_admin(user_id: int, message): status = False if message.is_private: return True async for user in client.iter_participants(message.chat_id, filter=ChannelParticipantsAdmins): if user_id == user.id or user_id in SUDO_USERS: status = True break return status