From 1435ea8ba4bd8f666ba0cd7da32fdcc2143a0a9e Mon Sep 17 00:00:00 2001 From: jcao219 Date: Fri, 22 Jul 2011 23:43:15 -0500 Subject: [PATCH] fixed a bug and made !frole case-insensitive --- wolfgame.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wolfgame.py b/wolfgame.py index 5259da1..8655290 100644 --- a/wolfgame.py +++ b/wolfgame.py @@ -88,6 +88,7 @@ def connect_callback(cli): var.GAME_START_TIME = datetime.now() # for idle checker only var.GRAVEYARD_LOCK = threading.RLock() + var.GAME_ID = 0 prepare_stuff() @@ -1337,12 +1338,14 @@ def frole(cli, nick, chan, rest): cli.msg(chan, "The syntax is incorrect.") who = rst.pop(0).strip() rol = " ".join(rst).strip() - if who not in var.USERS: + ull = [u.lower() for u in var.USERS] + if who.lower() not in ull: if not is_fake_nick(who): cli.msg(chan, "Could not be done.") cli.msg(chan, "The target needs to be in this channel or a fake name.") return - elif who == botconfig.NICK or not who: + who = var.USERS[ull.index(who.lower())] + if who == botconfig.NICK or not who: cli.msg(chan, "No.") return if rol not in var.ROLES.keys():