Browse Source

fixed a bug and made !frole case-insensitive

master
jcao219 14 years ago
parent
commit
1435ea8ba4
  1. 7
      wolfgame.py

7
wolfgame.py

@ -88,6 +88,7 @@ def connect_callback(cli): @@ -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): @@ -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():

Loading…
Cancel
Save