Commit 43d323bf authored by Trevor Cappallo's avatar Trevor Cappallo
Browse files

fix spamming score

parent 8dac27ec
......@@ -95,10 +95,9 @@ async def status_task():
for game in info['games']:
if "..." not in game['score'] and " -- " not in game['score']:
if "..." not in game['score'] and " -- " not in game['score'] and game['name'] in currentGames.keys():
out += [f"The {game['name']} game is finished. The final score was {game['score']}."]
if game['name'] in currentGames.keys():
del currentGames[game['name']]
del currentGames[game['name']]
for ongoing in currentGames.keys():
if ongoing not in [x['name'] for x in info['games']]:
out += [f"The {ongoing} game is finished. Final score: {currentGames[ongoing]['score']}"]
......@@ -106,9 +105,9 @@ async def status_task():
for xin in nix:
del currentGames[xin]
if len(newGames)>0:
if len(newGames)>0 or len(out)>0:
for game in newGames:
if game['ip']=='0':
if game['ip']=='0' and ' -- ' in game['score']:
if ' vs ' not in game['name']:
......@@ -125,9 +124,9 @@ async def status_task():
if len(recentlySaid) > 5:
recentlySaid = recentlySaid[-5:]
if len(out) > 0:
await ch.send("\n".join(out))
oldGames = [sorted([str(y) for y in x.values()]) for x in newGames]
# oldGames += newGames
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment