From efb78f538d01b3c626af3a1ae57b20d6be54cd83 Mon Sep 17 00:00:00 2001 From: Rogier Neeleman Date: Thu, 25 Sep 2014 14:44:48 +0200 Subject: [PATCH] Check if OPER and NickServ are needed --- botconfig.py.example | 4 ++-- modules/common.py | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/botconfig.py.example b/botconfig.py.example index 678a639..ea87703 100644 --- a/botconfig.py.example +++ b/botconfig.py.example @@ -3,8 +3,8 @@ CHANNEL = "#mywolfgame" HOST = "irc.freenode.net" PORT = 6667 USERNAME = "" # for authentication, can be left blank if same as NICK -OPERUSER = "OPPER user" -OPERPASS = "OPER password" +OPERUSER = "" +OPERPASS = "" NICK = "mywolfbot" NICKPASS = "nickserv password" CMD_CHAR = "!" diff --git a/modules/common.py b/modules/common.py index afc92c4..e0628cb 100644 --- a/modules/common.py +++ b/modules/common.py @@ -97,9 +97,10 @@ hook = decorators.generate(HOOKS, raw_nick=True, permissions=False) def connect_callback(cli): def prepare_stuff(*args): - cli.send("OPER", botconfig.OPERUSER, botconfig.OPERPASS) - #cli.msg("NickServ", "IDENTIFY", botconfig.NICKPASS) - cli.ns_identify(botconfig.NICKPASS) + if botconfig.OPERUSER and botconfig.OPERPASS: + cli.send("OPER", botconfig.OPERUSER, botconfig.OPERPASS) + if botconfig.NICKPASS: + cli.ns_identify(botconfig.NICKPASS) cli.join(botconfig.CHANNEL) cli.msg("ChanServ", "op "+botconfig.CHANNEL)