Singing in TelegramClient telethon

混江龙づ霸主 提交于 2021-01-29 06:08:25

问题


After running the code, I try to enter a password (but I don’t have it) and can’t enter anything. I use VS Code

  • Please enter your phone (or bot token): 79622222693
  • Please enter the code you received: 40589
  • Please enter your password: (CANT ENTER ANYTHING, AND I DON'T HAVE ANY PASS ON MY ACCOUNT)

Tried different accounts.

    from telethon import TelegramClient, sync
    api_id = 973111111111145
    api_hash = '05c6f86e67922222222222225ad7615a8'

    client = TelegramClient('sessi1onname', api_id, api_hash)
    client.start()

回答1:


from telethon.sync import TelegramClient

api_id = 0
api_hash = ''

with TelegramClient('sessi1onname', api_id, api_hash) as client:
    client.get_messages('me', "telethon sign in success")

use this code and then check your Saved Messages in telegram. will work for you. way you are trying is not sync!



来源:https://stackoverflow.com/questions/58590974/singing-in-telegramclient-telethon

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!