LonamiWebs / Telethon

Pure Python 3 MTProto API Telegram client library, for bots too!
https://docs.telethon.dev
MIT License
9.77k stars 1.39k forks source link

telethon.errors.rpcerrorlist.PasswordEmptyError: The provided password is empty (caused by ResetPasswordRequest) #3992

Closed Phatkervn closed 1 year ago

Phatkervn commented 1 year ago

Checklist

I don't ask to reset my password!

Code that causes the issue

from telethon.sync import TelegramClient
from telethon import functions, types

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.account.ResetPasswordRequest())
    print(result.stringify())
...

Traceback

Traceback (most recent call last):
  File "c:\Users\phatker\Desktop\TELEGRAM\resert2fa.py", line 34, in <module>
    ...
  File "c:\Users\phatker\Desktop\TELEGRAM\resert2fa.py", line 23, in reset
    result = client(functions.account.ResetPasswordRequest())
  File "C:\Users\phatker\AppData\Local\Programs\Python\Python39\lib\site-packages\telethon\sync.py", line 39, in syncified
    return loop.run_until_complete(coro)
  File "C:\Users\phatker\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
    return future.result()
  File "C:\Users\phatker\AppData\Local\Programs\Python\Python39\lib\site-packages\telethon\client\users.py", line 30, in __call__
    return await self._call(self._sender, request, ordered=ordered)
  File "C:\Users\phatker\AppData\Local\Programs\Python\Python39\lib\site-packages\telethon\client\users.py", line 84, in _call
    result = await future
telethon.errors.rpcerrorlist.PasswordEmptyError: The provided password is empty (caused by ResetPasswordRequest)

sorry , my english is not good

Lonami commented 1 year ago

You are using raw API, which means the results you are getting come directly from Telegram, and Telethon is not changing them in any way (other than adapting some input parameters where needed, all while respecting the intended values). Unfortunately this means it's something Telethon cannot "fix" and it's just the way Telegram's API works.