python - 在 python telethon 中加入 channel 的最简单方法

标签 python telegram telethon

我阅读电视节目文档到 retrieve an user-namejoin 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/

相关文章:

python - Tensorflow实践 y = xw 如何初始化向量x?

api - 为什么 Telethon 发送文件这么慢?

python - 采样音频不保留波(矢量)!

python - 运行时警告: coroutine 'main' was never awaited error

python - 将 StringSession 转换为 SQLiteSession 电视马拉松

python - 函数是否有一种通用的方法来引用自身?

python - 如何使用Python OpenCV创建此镜筒/径向变形?

python - 如何将绘图从连接点更改为垂直棒?

node.js - Telegram Bot with Telegraf.js - 发送消息进行聊天

telethon - 电报 api,我可以启动视频直播吗?