From a1cb1ae4d805bb50c9778608c737e73b3356ddb7 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 10 Feb 2004 03:29:02 +0000 Subject: [PATCH] Added ghost command, caught a few more errors in identify. --- plugins/Services.py | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/plugins/Services.py b/plugins/Services.py index bad6b4407..be83bf13b 100644 --- a/plugins/Services.py +++ b/plugins/Services.py @@ -210,12 +210,38 @@ class Services(privmsgs.CapabilityCheckingPrivmsg): Identifies with NickServ. """ if self.registryValue('NickServ', irc.network): - self._doIdentify(irc) - irc.replySuccess() + nick = self.registryValue('nick') + 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: irc.error('You must set supybot.plugins.Services.NickServ before ' '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