Added ghost command, caught a few more errors in identify.

This commit is contained in:
Jeremy Fincher 2004-02-10 03:29:02 +00:00
parent dd66098e3e
commit a1cb1ae4d8

View File

@ -210,12 +210,38 @@ class Services(privmsgs.CapabilityCheckingPrivmsg):
Identifies with NickServ. Identifies with NickServ.
""" """
if self.registryValue('NickServ', irc.network): if self.registryValue('NickServ', irc.network):
self._doIdentify(irc) nick = self.registryValue('nick')
irc.replySuccess() if nick != irc.nick:
irc.error('I can\'t identify without having my normal nick!')
elif not nick:
irc.error('You must set supybot.plugins.Services.nick before '
'I\'m able to identify.')
else:
self._doIdentify(irc)
irc.replySuccess()
else: else:
irc.error('You must set supybot.plugins.Services.NickServ before ' irc.error('You must set supybot.plugins.Services.NickServ before '
'I\'m able to do identify.') 'I\'m able to do identify.')
def ghost(self, irc, msg, args):
"""takes no arguments
Ghosts the bot's configured nick and retakes it.
"""
if self.registryValue('NickServ', irc.network):
nick = self.registryValue('nick')
if nick == irc.nick:
irc.error('I cowardly refuse to ghost myself.')
elif not nick:
irc.error('You must set supybot.plugins.Services.nick before '
'I\'m able to ghost a nick.')
else:
self._doGhost(irc)
irc.replySuccess()
else:
irc.error('You must set supybot.plugins.Services.NickServ before '
'I\'m able to ghost a nick.')
Class = Services Class = Services