A
A
Adam2021-02-04 17:20:55
Python
Adam, 2021-02-04 17:20:55

Telethon how to know in advance that the user has restricted the ability to add himself to groups?

Good day! I need to transfer the members of my chat from one group to another, so I collect their id in an array and try to add

usersi = [321412,124124234,124124]

client(InviteToChannelRequest(
    chatid,
    usersi
))


Of course, one of them limited the ability to add themselves to groups, I would like to find out who has this restriction during the initial filtering of users from bots

participants = client.get_participants(channel_username)
usersi=[]
chatid = client.get_entity(mychat).id

for partic in client.iter_participants(channel_username):

    if partic.bot:
        print(partic.id," бот")
    elif partic.deleted:
        print(partic.id, " Удален")
    else:
        usersi.append(partic.id)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Adam, 2021-02-05
@lollol9

To everyone who answers the question, health, happiness, love - beauty, fulfillment of desires and a lot of money)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question