Returns errors when passing a phone number in authorization in pyrogram,I don't know what the problem is, please help
Traceback (most recent call last):
File "/Users/nikitamakarov/PycharmProjects/pythonProject12/main.py", line 10, in <module>
sent_code_info = client.send_code(phone_number)
File "/Users/nikitamakarov/PycharmProjects/pythonProject12/venv/lib/python3.10/site-packages/pyrogram/sync.py", line 66, in async_to_sync_wrap
return loop.run_until_complete(coroutine)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/Users/nikitamakarov/PycharmProjects/pythonProject12/venv/lib/python3.10/site-packages/pyrogram/methods/auth/send_code.py", line 54, in send_code
r = await self.invoke(
File "/Users/nikitamakarov/PycharmProjects/pythonProject12/venv/lib/python3.10/site-packages/pyrogram/methods/advanced/invoke.py", line 79, in invoke
r = await self.session.invoke(
File "/Users/nikitamakarov/PycharmProjects/pythonProject12/venv/lib/python3.10/site-packages/pyrogram/session/session.py", line 389, in invoke
return await self.send(query, timeout=timeout)
File "/Users/nikitamakarov/PycharmProjects/pythonProject12/venv/lib/python3.10/site-packages/pyrogram/session/session.py", line 357, in send
RPCError.raise_it(result, type(data))
File "/Users/nikitamakarov/PycharmProjects/pythonProject12/venv/lib/python3.10/site-packages/pyrogram/errors/rpc_error.py", line 91, in raise_it
raise getattr(
pyrogram.errors.exceptions.flood_420.FloodWait: Telegram says: [420 FLOOD_WAIT_X] - A wait of 44927 seconds is required (caused by "auth.SendCode")
from pyrogram import Client
from pyrogram.errors import SessionPasswordNeeded, PhoneCodeInvalid, PasswordHashInvalid
api_id = YOUR_API_ID
api_hash = "YOUR_API_HASH"
phone_number = "YOUR_PHONE_NUMBER"
client = Client(":memory:", api_id, api_hash)
client.connect()
sent_code_info = client.send_code(phone_number)
phone_code = input("Please enter your phone code: ") # Sent phone code using last function
while True:
try:
client.sign_in(phone_number, sent_code_info.phone_code_hash, phone_code)
break
except SessionPasswordNeeded:
password = input("Please enter your pass: ") # Sent phone code using last function
try:
client.check_password(password)
break
except PasswordHashInvalid:
print("pass error try 1 more time")
except PhoneCodeInvalid:
print("code error try 1 more time")
client.send_message("me", "Thats work!") #Checking work