txlyre 2 meses atrás
pai
commit
4fed54ea1b
1 arquivos alterados com 10 adições e 2 exclusões
  1. 10 2
      main.py

+ 10 - 2
main.py

@@ -56,9 +56,14 @@ async def lols_check(user_id):
             async with session.get(f"https://api.lols.bot/account?id={user_id}") as response:
                 data = await response.json()
 
-                return data["banned"] or data["scammer"]
+                banned = data.get("banned", False)
+                scammer = data.get("scammer", False)
+
+                return not banned and not scammer
     except Exception:
-        return False
+        pass
+
+    return True
 
 class PendingUser:
     def __init__(self, peer_id, user_id):
@@ -209,6 +214,9 @@ async def handler(event):
     except Exception:
         pass
 
+    if pending_user.message_id is None:
+        return
+
     text = getattr(event, "text", "")
 
     await pending_user.check_captcha(text)