【发布时间】:2021-01-31 11:41:25
【问题描述】:
我无法使用 Telethon Bot 获取对话框,因为该方法仅适用于客户端。因此,当我尝试使用其 id 访问实体时,我收到一个错误。如果我无法解析所有频道并且既不能通过 id 访问它们,如何访问实体(频道)?我想解析来自私人群组的消息并使用 Telegram Bot。
【问题讨论】:
-
如果您告诉我们错误是什么会很有帮助
-
嗨@painor!谢谢您的答复。错误如下:
telethon.errors.rpcerrorlist.PeerIdInvalidError: An invalid Peer was used. Make sure to pass the right peer type (caused by ForwardMessagesRequest)因为 Telethon 不知道此 ID 与哪个频道相关。根据文档,我需要先列出所有对话框,然后通过 id 获取实体。请检查此链接link。
标签: python telegram-bot telethon