Skip to content

Commit f16352a

Browse files
committed
Switch admin_bot.py to new nick checks
1 parent fe05ae1 commit f16352a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

plugins/admin_bot.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,14 +298,15 @@ def cycle(text, conn, chan, notice):
298298

299299
@asyncio.coroutine
300300
@hook.command(permissions=["botcontrol"])
301-
def nick(text, conn, notice):
301+
def nick(text, conn, notice, is_nick_valid):
302302
"""<nick> - changes my nickname to <nick>
303303
:type text: str
304304
:type conn: cloudbot.client.Client
305305
"""
306-
if not re.match("^[a-z0-9_|.-\]\[]*$", text.lower()):
306+
if not is_nick_valid(text):
307307
notice("Invalid username '{}'".format(text))
308308
return
309+
309310
notice("Attempting to change nick to '{}'...".format(text))
310311
conn.set_nick(text)
311312

0 commit comments

Comments
 (0)