OperUp: disallow nesting

This commit is contained in:
GLolol 2014-02-11 19:17:22 -08:00
parent a42b9d8541
commit 480c89e39f

View File

@ -94,6 +94,8 @@ class OperUp(callbacks.Plugin):
"""takes no arguments.
Makes the bot Oper up using the name and password defined in config.
"""
if irc.nested:
irc.error("This command cannot be nested.", Raise=True)
if irc.network in self.registryValue('operNets'):
if self.registryValue("operName") and \
self.registryValue("operPass"):
@ -114,6 +116,8 @@ class OperUp(callbacks.Plugin):
"""takes no arguments.
Makes the bot deoper by setting user modes -Oo on itself.
"""
if irc.nested:
irc.error("This command cannot be nested.", Raise=True)
irc.sendMsg(ircmsgs.mode(irc.nick, "-Oo"))
irc.replySuccess()
deoper = wrap(deoper, ['owner'])