【问题标题】:joint group with Telegram API python (telithon telegram )与 Telegram API python (telithon telegram) 联合组
【发布时间】:2018-01-19 21:28:43
【问题描述】:
from telethon import TelegramClient
from telethon.tl.functions.messages import ImportChatInviteRequest
api_id = ++++
api_hash = '+++++++++++++++++++++'
client = TelegramClient('+1 ++++++', api_id, api_hash)
client.connect()
updates = client(ImportChatInviteRequest('GQVuGUG5pPEBxM6tQAeqqA'))

我想加入这个群电报 (https://t.me/joinchat/GQVuGUG5pPEBxM6tQAeqqA) 但是我有这个错误

Traceback (most recent call last):
updates = client(ImportChatInviteRequest('GQVuGUG5pPEBxM6tQAeqqA'))
   TypeError: 'TelegramClient' object is not callable

我使用这个脚本:https://github.com/LonamiWebs/Telethon/wiki/Joining-a-chat-or-channel

【问题讨论】:

  • 显然不能调用client,TelegramClient 实例。你为什么叫它?
  • 其他命令很好,但是当我想要联合组并使用 ImportChatInviteRequest 我看到错误
  • 在这种情况下,您应该向软件包维护者提出问题,因为假设您的 client 是正确的,但实际代码与文档不一致。
  • Tanx Lonami 我升级了 telithon 并且正在工作......

标签: python telegram


【解决方案1】:

用

升级 telithon 电报
pip install --upgrade telethon

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-09-22
    • 1970-01-01
    • 2019-08-07
    • 2021-06-08
    • 2018-04-07
    • 1970-01-01
    • 1970-01-01
    • 2018-11-17
    相关资源
    最近更新 更多