summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlan Aitbay <69082498+enganese@users.noreply.github.com>2023-05-23 21:38:59 +0200
committerGitHub <noreply@github.com>2023-05-23 21:38:59 +0200
commit13d4a04501437c47d9f0d3e48b0b7f79597e6e3b (patch)
treea95fe9ecf71615e9c52d577b6b6e2a9656c2f27b
parentMerge pull request #591 from enganese/patch-1 (diff)
downloadgpt4free-13d4a04501437c47d9f0d3e48b0b7f79597e6e3b.tar
gpt4free-13d4a04501437c47d9f0d3e48b0b7f79597e6e3b.tar.gz
gpt4free-13d4a04501437c47d9f0d3e48b0b7f79597e6e3b.tar.bz2
gpt4free-13d4a04501437c47d9f0d3e48b0b7f79597e6e3b.tar.lz
gpt4free-13d4a04501437c47d9f0d3e48b0b7f79597e6e3b.tar.xz
gpt4free-13d4a04501437c47d9f0d3e48b0b7f79597e6e3b.tar.zst
gpt4free-13d4a04501437c47d9f0d3e48b0b7f79597e6e3b.zip
-rw-r--r--gpt4free/usesless/__init__.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/gpt4free/usesless/__init__.py b/gpt4free/usesless/__init__.py
index 9efc410f..2295f640 100644
--- a/gpt4free/usesless/__init__.py
+++ b/gpt4free/usesless/__init__.py
@@ -52,7 +52,14 @@ class Account:
quit()
while True:
- time.sleep(5)
+ 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(