Private
Public Access
forked from FOSS/AutoShop-Djimbo-Simple
fix(lolzteam): add type conversion and validation checks
This commit is contained in:
@@ -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>")
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user