diff --git a/OperUp/config.py b/OperUp/config.py index 74f137b..ee0aef1 100644 --- a/OperUp/config.py +++ b/OperUp/config.py @@ -59,5 +59,7 @@ conf.registerGlobalValue(OperUp, 'operNets', conf.registerGlobalValue(OperUp, 'operModes', registry.SpaceSeparatedListOfStrings("", _("""Specifies the mode(s) the bot will set on itself when it Opers up."""), private=True)) - -# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: \ No newline at end of file +conf.registerGlobalValue(OperUp, 'autoOper', + registry.Boolean(True, _("""Specifies whether the bot should automatically + oper up on connect."""))) +# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: diff --git a/OperUp/plugin.py b/OperUp/plugin.py index b44ad94..23a272a 100644 --- a/OperUp/plugin.py +++ b/OperUp/plugin.py @@ -48,6 +48,8 @@ class OperUp(callbacks.Plugin): def do005(self, irc, msg): """Oper up on connect.""" + if not self.registryValue('autoOper'): + return if irc.network in self.registryValue('operNets'): if self.registryValue("operName") and \ self.registryValue("operPass"): @@ -55,7 +57,7 @@ class OperUp(callbacks.Plugin): args=[self.registryValue("operName"), self.registryValue("operPass")])) else: - self.log.error("OperUp: Bot is set to oper on network %s, but" + self.log.warning("OperUp: Bot is set to oper on network %s, but" " operName and/or operPass are not defined!") def do381(self, irc, msg): @@ -102,15 +104,15 @@ class OperUp(callbacks.Plugin): else: irc.error(_("Either the operName or the operPass " "configuration values were not properly defined. Please " - "check to see these values are correct!")) + "check to see if these values are correct!")) else: - irc.error(_("This network is not configured for opering up! (see" + irc.error(_("This network is not configured for opering! (see" " @config plugins.OperUp.opernets)")) operup = wrap(operup, ['owner']) def deoper(self, irc, msg, args): """takes no arguments. - Deopers the bot. (set user modes -Oo) + Makes the bot deoper by setting user modes -Oo on itself. """ irc.sendMsg(ircmsgs.mode(irc.nick, "-Oo")) irc.replySuccess()