コード例 #1
0
ファイル: fokabotCommands.py プロジェクト: Snowawa/pep.py-1
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
コード例 #2
0
ファイル: fokabotCommands.py プロジェクト: mnkprs/pep.py
 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