Send match history link after the first match

This commit is contained in:
Giuseppe Guerra 2018-08-04 19:49:38 +02:00
parent cb2d1e74f7
commit 887836045d
1 changed files with 9 additions and 1 deletions

View File

@ -66,6 +66,7 @@ class match:
self.isStarting = False
self._lock = threading.Lock()
self.createTime = int(time.time())
self.vinseID = None
# Create all slots and reset them
self.slots = []
@ -433,9 +434,16 @@ class match:
# Console output
log.info("MPROOM{}: Match completed".format(self.matchID))
# Set vinse id if needed
chanName = "#multi_{}".format(self.matchID)
if self.vinseID is None:
self.vinseID = (int(time.time()) // (60 * 15)) << 32 | self.matchID
chat.sendMessage("FokaBot", chanName, "Match history available [{} here]".format(
"https://vinse.ripple.moe/match/{}".format(self.vinseID)
))
# 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.")