From e3e46a34ec367a40ca4a3977635e781959c89dbb Mon Sep 17 00:00:00 2001 From: Morgan Bazalgette Date: Sat, 9 Sep 2017 12:30:25 +0200 Subject: [PATCH] Notify the chat when the match has been completed. --- objects/match.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/objects/match.py b/objects/match.py index 29bd2f5..da9c496 100644 --- a/objects/match.py +++ b/objects/match.py @@ -427,6 +427,12 @@ class match: # Console output log.info("MPROOM{}: Match completed".format(self.matchID)) + # If this is a tournament match, then we send a notification in the chat + # saying that the match has completed. + chanName = "#multi_{}".format(self.matchID) + if self.isTourney and (chanName in glob.channels.channels): + chat.sendMessage("FokaBot", chanName, "Match has just finished.") + def resetSlots(self): for i in range(0,16): if self.slots[i].user is not None and self.slots[i].status == slotStatuses.PLAYING: @@ -826,7 +832,7 @@ class match: totalUsers = 0 readyUsers = 0 - for slot in match.slots: + for slot in self.slots: # Make sure there is a user in this slot if slot.user is None: continue