Browse Source

checks

master
gsd 2 years ago
parent
commit
aca0198280
  1. 10
      tradebot.facti13.external.py

10
tradebot.facti13.external.py

@ -1,5 +1,6 @@
import steam as SteamPy
import argparse, os, sys
import asyncio
from colors import *
from json import load
import asyncio
@ -55,7 +56,7 @@ async def send_msg(trade: SteamPy.TradeOffer, message: str):
class SteamClient(SteamPy.Client):
items = TradeChecker()
trade_tracker = {}
backend = BackendClient()
backend : BackendClient = None
async def on_ready(self):
info(f"Logged in as: {self.user}")
@ -148,12 +149,19 @@ class SteamClient(SteamPy.Client):
if __name__ == "__main__":
print(f"Build date: {os.getenv('BUILDDATE', 'not set')}")
backend = BackendClient()
asyncio.get_event_loop().run_until_complete(backend.pulse())
if not backend.up:
print("backend not working down bot")
sys.exit(200)
parser = argparse.ArgumentParser()
parser.add_argument("--auth-file", type=str, default=os.environ.get("AUTH_FILE", ""))
parser.add_argument("--steam-secret", type=str, default=os.environ.get("STEAM_SECRET", ""))
args = parser.parse_args()
client = SteamClient(game = SteamPy.Game(id=440))
client.backend = backend
if args.auth_file and args.steam_secret:
try:

Loading…
Cancel
Save