Fixes #184 (!swap, when targeting someone, should be case insensitive)

This commit is contained in:
William Maduno | Diitto 2015-12-02 18:46:52 -08:00 committed by jacob1
parent 00ddf27e23
commit f552a6e86e

View File

@ -767,7 +767,15 @@ def replace(cli, nick, chan, rest):
cli.notice(nick, msg)
return
else:
target, _ = complete_match(rest[0], var.list_players() + list(var.VENGEFUL_GHOSTS.keys()))
pl = var.list_players() + list(var.VENGEFUL_GHOSTS.keys())
pll = [var.irc_lower(i) for i in pl]
lc_target, _ = complete_match(var.irc_lower(rest[0]), pll)
if lc_target != None:
target = pl[pll.index(lc_target)]
else:
target = ""
if target not in var.list_players() and target not in var.VENGEFUL_GHOSTS:
msg = messages["target_not_playing"].format(" longer" if target in var.DEAD else "t")