fix(lolzteam): add type conversion and validation checks

This commit is contained in:
2026-07-16 05:28:27 +05:00
parent f2f8356d99
commit 8181394b40
2 changed files with 8 additions and 3 deletions
+7 -2
View File
@@ -104,7 +104,12 @@ class LolzteamAPI:
status, response = await self._request("me", method="GET")
merchant_valid = False
if status and "errors" not in response and self.merchant_id:
if (
status
and "errors" not in response
and "balances" in response["user"]
and self.merchant_id
):
balances = response["user"]["balances"]
for balance in balances:
@@ -125,7 +130,7 @@ class LolzteamAPI:
elif status and "errors" not in response and not self.merchant_id:
return True, ded(
f"""
<b>🟢 Lolzteam полностью функционирует ✅</b>
<b>🟢 Lolzteam функционирует ✅</b>
➖➖➖➖➖➖➖➖➖➖
▪️ Токен: <code>{self.token}</code>
▪️ Айди: <code>{response['user']['user_id']}</code>