mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-05-03 00:41:15 -05:00
OperUp: add option to toggle autooper
This commit is contained in:
parent
b232a14687
commit
82d9d73e0b
@ -59,5 +59,7 @@ conf.registerGlobalValue(OperUp, 'operNets',
|
|||||||
conf.registerGlobalValue(OperUp, 'operModes',
|
conf.registerGlobalValue(OperUp, 'operModes',
|
||||||
registry.SpaceSeparatedListOfStrings("", _("""Specifies the mode(s) the
|
registry.SpaceSeparatedListOfStrings("", _("""Specifies the mode(s) the
|
||||||
bot will set on itself when it Opers up."""), private=True))
|
bot will set on itself when it Opers up."""), private=True))
|
||||||
|
conf.registerGlobalValue(OperUp, 'autoOper',
|
||||||
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
registry.Boolean(True, _("""Specifies whether the bot should automatically
|
||||||
|
oper up on connect.""")))
|
||||||
|
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
||||||
|
@ -48,6 +48,8 @@ class OperUp(callbacks.Plugin):
|
|||||||
|
|
||||||
def do005(self, irc, msg):
|
def do005(self, irc, msg):
|
||||||
"""Oper up on connect."""
|
"""Oper up on connect."""
|
||||||
|
if not self.registryValue('autoOper'):
|
||||||
|
return
|
||||||
if irc.network in self.registryValue('operNets'):
|
if irc.network in self.registryValue('operNets'):
|
||||||
if self.registryValue("operName") and \
|
if self.registryValue("operName") and \
|
||||||
self.registryValue("operPass"):
|
self.registryValue("operPass"):
|
||||||
@ -55,7 +57,7 @@ class OperUp(callbacks.Plugin):
|
|||||||
args=[self.registryValue("operName"),
|
args=[self.registryValue("operName"),
|
||||||
self.registryValue("operPass")]))
|
self.registryValue("operPass")]))
|
||||||
else:
|
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!")
|
" operName and/or operPass are not defined!")
|
||||||
|
|
||||||
def do381(self, irc, msg):
|
def do381(self, irc, msg):
|
||||||
@ -102,15 +104,15 @@ class OperUp(callbacks.Plugin):
|
|||||||
else:
|
else:
|
||||||
irc.error(_("Either the operName or the operPass "
|
irc.error(_("Either the operName or the operPass "
|
||||||
"configuration values were not properly defined. Please "
|
"configuration values were not properly defined. Please "
|
||||||
"check to see these values are correct!"))
|
"check to see if these values are correct!"))
|
||||||
else:
|
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)"))
|
" @config plugins.OperUp.opernets)"))
|
||||||
operup = wrap(operup, ['owner'])
|
operup = wrap(operup, ['owner'])
|
||||||
|
|
||||||
def deoper(self, irc, msg, args):
|
def deoper(self, irc, msg, args):
|
||||||
"""takes no arguments.
|
"""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.sendMsg(ircmsgs.mode(irc.nick, "-Oo"))
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user