Make guest nick pattern configurable

Closes #247.
This commit is contained in:
nyuszika7h 2016-08-29 00:55:36 +02:00
parent 1082736d2e
commit 8bd98b9e5c
2 changed files with 3 additions and 1 deletions

View File

@ -197,6 +197,8 @@ NICKSERV_REGAIN_COMMAND = "REGAIN {nick}"
CHANSERV = "ChanServ"
CHANSERV_OP_COMMAND = "OP {channel}"
GUEST_NICK_PATTERN = r"^Guest\d+$"
LOG_CHANNEL = "" # Log !fwarns to this channel, if set
# TODO: move this to a game mode called "fixed" once we implement a way to randomize roles (and have that game mode be called "random")

View File

@ -3595,7 +3595,7 @@ def on_nick(cli, oldnick, nick):
prefix, _, ident, host = parse_nick(oldnick)
chan = botconfig.CHANNEL
if (re.search(r"^Guest\d+$", nick) or nick[0].isdigit() or (nick != "away" and "away" in nick.lower())) and nick not in var.DISCONNECTED.keys() and prefix in list_players():
if (re.search(var.GUEST_NICK_PATTERN, nick) or nick[0].isdigit() or (nick != "away" and "away" in nick.lower())) and nick not in var.DISCONNECTED.keys() and prefix in list_players():
if var.PHASE != "join":
cli.mode(chan, "-v", nick)
leave(cli, "badnick", oldnick)