Пример #1
0
async def is_user_in_chat(chat_id: int, user_id: int):
    status = False
    async for user in telethn.iter_participants(chat_id):
        if user_id == user.id:
            status = True
            break
    return status
Пример #2
0
async def is_user_admin(user_id: int, chat_id):
    status = False
    async for user in telethn.iter_participants(
            chat_id, filter=ChannelParticipantsAdmins):
        if user_id == user.id or user_id in DRAGONS:
            status = True
            break
    return status
Пример #3
0
async def saitama_is_admin(chat_id: int):
    status = False
    saitama = await telethn.get_me()
    async for user in telethn.iter_participants(
            chat_id, filter=ChannelParticipantsAdmins):
        if saitama.id == user.id:
            status = True
            break
    return status
Пример #4
0
async def user_is_ban_protected(user_id: int, message):
    status = False
    if message.is_private or user_id in (IMMUNE_USERS):
        return True

    async for user in telethn.iter_participants(
            message.chat_id, filter=ChannelParticipantsAdmins):
        if user_id == user.id:
            status = True
            break
    return status
Пример #5
0
async def user_is_admin(user_id: int, message):
    status = False
    if message.is_private:
        return True

    async for user in telethn.iter_participants(
            message.chat_id, filter=ChannelParticipantsAdmins):
        if user_id == user.id or user_id in DRAGONS:
            status = True
            break
    return status
Пример #6
0
async def cutiepii_is_admin(chat_id: int):
    status = False
    cutiepii = await telethn.get_me()
    async for user in telethn.iter_participants(
            chat_id,
            filter=ChannelParticipantsAdmins,
    ):
        if cutiepii.id == user.id:
            status = True
            break
    return status