From f5cb6460871a52b77619e67f9ca383a9a4f467ec Mon Sep 17 00:00:00 2001 From: Kevin Rode Date: Mon, 4 Jan 2021 02:17:39 -0500 Subject: [PATCH] Moved db save command to the right spot --- the_prestige.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/the_prestige.py b/the_prestige.py index f1c8024..178ba7d 100644 --- a/the_prestige.py +++ b/the_prestige.py @@ -685,12 +685,13 @@ async def watch_game(channel, newgame, user = None): await embed.unpin() gamesarray.pop(gamesarray.index(newgame)) #cleanup is important! newgame.add_stats() + db.cache_history(newgame.teams['home'].name, newgame.teams["home"].score, newgame.teams['away'].name, newgame.teams['away'].score) del newgame if len(gamesqueue) > 0: channel, game, user_mention = gamesqueue.pop(0) queue_task = asyncio.create_task(play_from_queue(channel, game, user_mention)) await queue_task - db.cache_history(newgame.teams['home'].name, newgame.teams["home"].score, newgame.teams['away'].name, newgame.teams['away'].score) + async def play_from_queue(channel, game, user_mention): await channel.send(f"{user_mention}, your game's ready.")