小编alt*_*t4s的帖子

登录我的帐户时,Telethon 不断将我注销。电报、Python

该代码似乎运行完美,在我最终再次注销之前,我什至有时间用机器人对其进行了短暂的测试。此时我已经尝试了大约 10 次,但 Telethon 似乎出于某种原因将我从手机上的 Telegram 中删除了。我不知道为什么会发生这种情况,而且我也没有看到其他人遇到过这个问题。

负责登录的代码片段:

async def get_channel_messages(chat_id, msg_id):
    # Telegram API ID and Hash (you can get it from my.telegram.org)
    api_id = '12345678'
    api_hash = '1234'
    session_hash='hash'
    # Identify your bot with his ID number, can be found using this link
    my_bot_id = '12345'
    # Storing max 3 past messages
    max_memory_message = 3

    chat_id = int(chat_id)
    data = {}
      
    # Create a Telegram client with the given session string
    async with TelegramClient(StringSession(session_hash), api_id, api_hash) as client: …
Run Code Online (Sandbox Code Playgroud)

python telegram telethon

5
推荐指数
0
解决办法
1059
查看次数

标签 统计

python ×1

telegram ×1

telethon ×1