我阅读电视节目文档到 retrieve an user-name和 join a channel .经过一些尝试,我写了这段代码:
result = client.invoke(ResolveUsernameRequest('XXXX'))
channel = InputChannel(result.peer.channel_id, result.chats[0].access_hash)
client.invoke(JoinChannelRequest(channel))
这段代码工作正常,但我想知道是否有更好或更简单的方法?
最佳答案
第一次升级电视节目
from telethon.tl.functions.messages import ImportChatInviteRequest
updates = client(ImportChatInviteRequest('hash_invite _channel'))
关于python - 在 python telethon 中加入 channel 的最简单方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44996317/