diff --git a/main_controller.py b/main_controller.py index 0fdfb38..01d35a5 100644 --- a/main_controller.py +++ b/main_controller.py @@ -13,7 +13,6 @@ def index(): @app.route('/league') def league(): - print(request.args) return render_template("index.html", league=request.args['name']) thread2 = threading.Thread(target=socketio.run,args=(app,'0.0.0.0')) diff --git a/the_prestige.py b/the_prestige.py index 239595b..31535e4 100644 --- a/the_prestige.py +++ b/the_prestige.py @@ -1,4 +1,4 @@ -import discord, json, math, os, roman, games, asyncio, random, main_controller, threading, time, leagues +import discord, json, math, os, roman, games, asyncio, random, main_controller, threading, time, leagues, urllib import database as db import onomancer as ono from flask import Flask @@ -646,7 +646,11 @@ async def watch_game(channel, newgame, user = None, league = None): discrim_string = "Unclaimed game." state_init["is_league"] = False - await channel.send(f"{newgame.teams['away'].name} vs. {newgame.teams['home'].name}, starting at {config()['simmadome_url']}") + if league is not None: + league_ext = "league?name=" + urllib.parse.quote_plus(league) + else: + league_ext = "" + await channel.send(f"{newgame.teams['away'].name} vs. {newgame.teams['home'].name}, starting at {config()['simmadome_url']+league_ext}") timestamp = str(time.time() * 1000.0) gamesarray.append((newgame, channel, user, timestamp))