Fix message about invalid game mode when joining (#288)

Using `!join` followed by something should not result in an error message. If a gamemode can be voted for, do it, otherwise silently do nothing.
This commit is contained in:
Fudster 2017-02-22 12:34:46 -05:00 committed by Emanuel Barry
parent 05b900ef57
commit c64526b248

View File

@ -6846,10 +6846,12 @@ def vote_gamemode(var, wrapper, gamemode, doreply):
if gamemode not in var.GAME_MODES.keys():
matches = complete_match(gamemode, var.GAME_MODES.keys() - {"roles", "villagergame"} - var.DISABLED_GAMEMODES)
if not matches:
wrapper.pm(messages["invalid_mode"].format(gamemode))
if doreply:
wrapper.pm(messages["invalid_mode"].format(gamemode))
return
if len(matches) > 1:
wrapper.pm(messages["ambiguous_mode"].format(gamemode, ", ".join(matches)))
if doreply:
wrapper.pm(messages["ambiguous_mode"].format(gamemode, ", ".join(matches)))
return
if len(matches) == 1:
gamemode = matches[0]