如何将电报频道的成员转移到另一个电报频道

时间:2017-08-29 11:02:55

标签: bots telegram channel

如何将电报频道(我是他们的管理员)或群组(或超级群组)的成员转移到另一个电报频道或群组(我不是他们的管理员)? 此致

3 个答案:

答案 0 :(得分:0)

您无法在Telegram中执行此操作,只需将邀请链接发送到您的论坛即可。

如果您有合理的理由,请尝试联系App中的支持者,但没有关于迁移渠道的先例。

答案 1 :(得分:0)

您可以非常容易地使用telethon,并且那里有很多文档。

针对您的特定问题

from telethon.tl.functions.channels import InviteToChannelRequest

client(InviteToChannelRequest(
channel=SomeChannelId, 
users = ['SomeUserName']
))

答案 2 :(得分:0)

我曾经使用过Telethon:

from telethon import TelegramClient
from telethon.tl.functions.channels import InviteToChannelRequest
from telethon.tl.functions.channels import GetParticipantsRequest
import asyncio

# Use your own values from my.telegram.org
api_id = 12345
api_hash = 'a1a1a1a1a1a1a11'

channel_to_name = 'migrate_to'
channel_from_name = 'migrate_from'
loop = asyncio.get_event_loop()


client = TelegramClient('anon', api_id, api_hash)
loop.run_until_complete(client.connect())
channel_from = loop.run_until_complete(client.get_entity(channel_from_name))
channel_to = loop.run_until_complete(client.get_entity(channel_to_name))
users = client.iter_participants(channel_from)
users_arr = []
for user in users:
    users_arr.append(user)
loop.run_until_complete(client(InviteToChannelRequest(
        channel_to,
        users_arr
    )))