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() ).check()
if status: 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>") await cache_message.edit_text("<b>🟢 Lolzteam был успешно изменён ✅</b>")
else: else:
await cache_message.edit_text("<b>🟢 Не удалось изменить Lolzteam ❌</b>") 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") status, response = await self._request("me", method="GET")
merchant_valid = False 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"] balances = response["user"]["balances"]
for balance in balances: for balance in balances:
@@ -125,7 +130,7 @@ class LolzteamAPI:
elif status and "errors" not in response and not self.merchant_id: elif status and "errors" not in response and not self.merchant_id:
return True, ded( return True, ded(
f""" f"""
<b>🟢 Lolzteam полностью функционирует ✅</b> <b>🟢 Lolzteam функционирует ✅</b>
➖➖➖➖➖➖➖➖➖➖ ➖➖➖➖➖➖➖➖➖➖
▪️ Токен: <code>{self.token}</code> ▪️ Токен: <code>{self.token}</code>
▪️ Айди: <code>{response['user']['user_id']}</code> ▪️ Айди: <code>{response['user']['user_id']}</code>