From 9ad6ba3f6b45f91ed5e08222ed95e5286bfbdbac Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Mon, 3 Jul 2017 21:16:07 +0200 Subject: [PATCH] more nickserv fun --- src/ircbot/irc3module.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/ircbot/irc3module.py b/src/ircbot/irc3module.py index 0fe35995..f92cefc9 100644 --- a/src/ircbot/irc3module.py +++ b/src/ircbot/irc3module.py @@ -53,6 +53,9 @@ class Plugin(object): def on_privmsg(self, **kwargs): """triggered when a privmsg is sent to the bot or to a channel the bot is in""" logger.debug("inside on_privmsg(), kwargs: %s" % kwargs) + if kwargs['mask'] == "NickServ!NickServ@services.baconsvin.org" and kwargs['event'] == "NOTICE" and kwargs['data'] == "This nickname is registered. Please choose a different nickname, or identify via \x02/msg NickServ identify \x02.": + logger.info("Nickserv identify needed, fixing...") + bot.privmsg("NickServ@services.baconsvin.org", "identify %s %s" % (settings.IRCBOT_NICK, settings.IRCBOT_NICKSERV_PASSWORD)) @irc3.event(irc3.rfc.KICK) @@ -60,13 +63,6 @@ class Plugin(object): logger.debug("inside on_kick(), kwargs: %s" % kwargs) - @irc3.event(r'(@(?P\S+) )?:(?PNickServ)!NickServ@services.baconsvin.org' r' NOTICE (?Pirc3) :This nickname is registered.*') - def needs_nickserv_identify(self, **kwargs): - """Triggered when we need to identify with nickserv after connecting""" - logger.info("Nickserv identify needed, fixing...") - bot.privmsg("NickServ@services.baconsvin.org", "identify %s %s" % (settings.IRCBOT_NICK, settings.IRCBOT_NICKSERV_PASSWORD)) - - ############################################################################################### ### custom irc3 methods