From adb039e83d56ede3dec1c65b520192492652f918 Mon Sep 17 00:00:00 2001 From: nyuszika7h Date: Wed, 14 Jan 2015 19:47:13 +0100 Subject: [PATCH] Make !vote/!v work as an alias for !game in the join phase --- modules/wolfgame.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/wolfgame.py b/modules/wolfgame.py index 7f8a702..06b1658 100644 --- a/modules/wolfgame.py +++ b/modules/wolfgame.py @@ -3283,8 +3283,8 @@ def no_lynch(cli, nick, chan, rest): chk_decision(cli) return -@cmd("lynch", "vote", "v", game=True, playing=True, pm=True) -def vote(cli, nick, chan, rest): +@cmd("lynch", game=True, playing=True, pm=True) +def lynch(cli, nick, chan, rest): """Use this to vote for a candidate to be lynched.""" if not rest: show_votes(cli, nick, chan, rest) @@ -6490,6 +6490,17 @@ def game_help(args=''): else gamemode for gamemode in var.GAME_MODES.keys() if gamemode != "roles"]) game.__doc__ = game_help + +@cmd("vote", "v", raw_nick=True, pm=True) +def vote(cli, raw_nick, chan, rest): + nick = parse_nick(raw_nick)[0] + + if var.PHASE == "join" and chan != nick: + return game(cli, raw_nick, chan, rest) + else: + return lynch(cli, nick, chan, rest) + + @cmd("fpull", admin_only=True, pm=True) def fpull(cli, nick, chan, rest): """Pulls from the repository to update the bot."""