From f0c164fd5185fa762bf92a823e834915e9826577 Mon Sep 17 00:00:00 2001 From: Elnath Date: Tue, 20 Jul 2021 22:39:15 +0200 Subject: [PATCH] If auto end vote is off, ping GM when everybody has voted --- GameFiles/Game.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/GameFiles/Game.py b/GameFiles/Game.py index 4c1d784..5de2127 100644 --- a/GameFiles/Game.py +++ b/GameFiles/Game.py @@ -434,8 +434,11 @@ class Game: if not self.can_cast_votes(): raise RuntimeError("Votes can not be casted right now") self.config["vote"][str(user.id)] = vote - if self.get_auto_end_vote() and all(self.config["vote"][str(player_id)] is not None for player_id in self.get_players_id()): - asyncio.create_task(self.stop_vote()) + if all(self.config["vote"][str(player_id)] is not None for player_id in self.get_players_id()): + if self.get_auto_end_vote(): + asyncio.create_task(self.stop_vote()) + else: + asyncio.create_task(self.get_gm_channel().send(f"<@&{self.get_gm_role_id()}> Everybody has voted", allowed_mentions = discord.AllowedMentions(roles = True))) await self.update_vote_message() @vote_running