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
+1 -1
View File
@@ -320,7 +320,7 @@ async def payments_lolzteam_merchant_id_get(
).check()
if status:
await Paymentsx().update(lolzteam_merchant_id=get_merchant_id)
await Paymentsx().update(lolzteam_merchant_id=int(get_merchant_id))
await cache_message.edit_text("<b>🟢 Lolzteam был успешно изменён ✅</b>")
else:
await cache_message.edit_text("<b>🟢 Не удалось изменить Lolzteam ❌</b>")
+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>