From 07034539e9c7f19cbdb70f4fa0458c1c6fc1d893 Mon Sep 17 00:00:00 2001 From: gsd Date: Thu, 16 Mar 2023 19:39:38 +0300 Subject: [PATCH] fix --- backend_integration.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend_integration.py b/backend_integration.py index 0c8b447..44f2415 100644 --- a/backend_integration.py +++ b/backend_integration.py @@ -5,6 +5,7 @@ from steam import SteamID class BackendClient: up = False + warn = False def __init__(self): if not os.getenv("BACKEND_URL", ""): @@ -24,16 +25,20 @@ class BackendClient: try: await response.text() self.up = True + if not self.warn: + info("Backend connected!") + self.warn = True except: error("Backend not respond") traceback.print_exc() self.up = False + self.warn = False return self.up async def vip(self, steamid: SteamID, amount: int, extra: str): async with aiohttp.ClientSession(cookies={ "secretkey":self.secret_key}) as session: - async with session.post(self.vip_url + f"?steam={steamid.id64}&amount={amount}&service=steam&extra={extra}", ssl=False) as response: + async with session.post(self.vip_url + f"?steam={steamid.id64}&amount={int(amount)}&service=steam&extra={extra}", ssl=False) as response: try: result = int(await response.text()) if result == 0: