def getSpectatorHostUserIDFromChannel(chan): if not chan.lower().startswith("#spect_"): raise exceptions.wrongChannelException() parts = chan.lower().split("_") if len(parts) < 2 or not parts[1].isdigit(): raise exceptions.wrongChannelException() userID = int(parts[1]) return userID
def getMatchIDFromChannel(chan): if not chan.lower().startswith("#multi_"): raise exceptions.wrongChannelException() parts = chan.lower().split("_") if len(parts) < 2 or not parts[1].isdigit(): raise exceptions.wrongChannelException() matchID = int(parts[1]) if matchID not in glob.matches.matches: raise exceptions.matchNotFoundException() return matchID