问题
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