Browse Source

double vip fix

master
gsd 2 years ago
parent
commit
30eb5ea460
  1. 4
      backend_integration.py
  2. 2
      tradebot.facti13.external.py

4
backend_integration.py

@ -35,10 +35,10 @@ class BackendClient:
self.warn = False
return self.up
async def vip(self, steamid: SteamID, amount: int, extra: str):
async def vip(self, steamid: SteamID, amount: int, extra: str, unique: str = ""):
async with aiohttp.ClientSession(cookies={
"secretkey":self.secret_key}) as session:
async with session.post(self.vip_url + f"?steam={steamid.id64}&amount={int(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}&unique={unique}", ssl=False) as response:
try:
result = int(await response.text())
if result == 0:

2
tradebot.facti13.external.py

@ -142,7 +142,7 @@ class SteamClient(SteamPy.Client):
warning("Backend not responde, any time try add vip")
extra = f"keys={self.items.mannco_key(trade.items_to_receive)};metal={self.items.pure_metal(trade.items_to_receive)};"
seconds = self.items.Items2Seconds(trade.items_to_receive)
result = await self.backend.vip(trade.partner, seconds, extra)
result = await self.backend.vip(trade.partner, seconds, extra, unique=f"steam_{trade.id}")
if result == 99:
await send_msg(trade, "Спасибо за вещи, но у тебя уже есть КРУТЫЕ права на фактах")

Loading…
Cancel
Save