Telethon InviteToChannelRequest

Viewed 222

Hello I tried to add users to my Channel with telethon InviteToChannelRequest. My code:

    channel = InputPeerChannel(id, hash)
    user = InputPeerUser(id, hash)
    client(InviteToChannelRequest(channel=channel, users=[user]))

I don't get an error but it doesn't work. I tried with nearly all possible types of channel and users, but nothing seems to work. Any idea of what I am doing wrong?

1 Answers

You could use AddChatUserRequest method:

client(AddChatUserRequest(
    chat_id=123456789,
    user_id=example,
    fwd_limit=10
))

Note: you need to be an channel admin

Related