Send alert when doing !mp join from an IRC client

This commit is contained in:
Giuseppe Guerra 2018-08-04 18:53:04 +02:00
parent a456508ed3
commit 1dc37ecb77
1 changed files with 6 additions and 0 deletions

View File

@ -788,6 +788,12 @@ def multiplayer(fro, chan, message):
raise exceptions.invalidArgumentsException("Wrong syntax: !mp join <id>")
matchID = int(message[1])
userToken = glob.tokens.getTokenFromUsername(fro, ignoreIRC=True)
if userToken is not None:
raise exceptions.invalidArgumentsException(
"No game clients found for {}, can't join the match. "
"If you're a referee and you want to join the chat "
"channel from IRC, use /join #multi_{} instead.".format(fro, matchID)
)
userToken.joinMatch(matchID)
return "Attempting to join match #{}!".format(matchID)