Updated gpt4free/usesless/__init__.py (email confirmation in while loop)

This commit is contained in:
Ulan Aitbay 2023-05-24 00:38:59 +05:00 committed by GitHub
parent a076cd916a
commit 13d4a04501
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,7 +52,14 @@ class Account:
quit()
while True:
messages = mail_client.message_list()
# Check if method `message_list()` didn't return None or empty list.
if not messages or len(messages) == 0:
# If it returned None or empty list sleep for 5 seconds to wait for new message.
time.sleep(5)
continue
message_id = mail_client.message_list()[0]["id"]
message = mail_client.message(message_id)
verification_url = re.findall(