'Add member to telegram channel

I have been looking for a way to add a number of users to a telegram channel (with users id) for a long time and I didn't find anything. (I'm sure there is such a thing because I know people who do it but IDK and they don't tell me how it is done).

Thanks in advance for your help



Solution 1:[1]

First of all, please note that only the first 200 members can be added to a Telegram channel, and you should be aware that you are subject to get limited or banned if you abuse the Telegram API.

You can add members to a Telegram channel by calling the channels.inviteToChannel method.

If you use Python, you can do that easily with Pyrogram:

client.add_chat_members(
  channel_id,
  [user_ids],
)

You can also call the method easily with GramJS, if using JavaScript:

client.invoke(
  new Api.channels.InviteToChannel({
    channel: channelId,
    users: [userIds],
  })
)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1