If auto end vote is off, ping GM when everybody has voted

This commit is contained in:
Elnath 2021-07-20 22:39:15 +02:00
parent 7e60012118
commit f0c164fd51
1 changed files with 5 additions and 2 deletions

View File

@ -434,8 +434,11 @@ class Game:
if not self.can_cast_votes(): if not self.can_cast_votes():
raise RuntimeError("Votes can not be casted right now") raise RuntimeError("Votes can not be casted right now")
self.config["vote"][str(user.id)] = vote 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()): 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()) 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() await self.update_vote_message()
@vote_running @vote_running