From 205e11271869600027b16c33189290a2fa28c33e Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Mon, 3 Jul 2017 21:08:47 +0200 Subject: [PATCH] add nickserv functionality --- src/bornhack/environment_settings.py.dist | 1 + src/ircbot/irc3module.py | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/bornhack/environment_settings.py.dist b/src/bornhack/environment_settings.py.dist index 5b1abb5a..9b63ae03 100644 --- a/src/bornhack/environment_settings.py.dist +++ b/src/bornhack/environment_settings.py.dist @@ -74,6 +74,7 @@ SCHEDULE_EVENT_NOTIFICATION_MINUTES=10 # irc bot settings IRCBOT_CHECK_MESSAGE_INTERVAL_SECONDS=60 IRCBOT_NICK='{{ django_ircbot_nickname }}' +IRCBOT_NICKSERV_PASSWORD='{{ django_ircbot_nickserv_password }}' IRCBOT_SERVER_HOSTNAME='{{ django_ircbot_server }}' IRCBOT_SERVER_PORT=6697 IRCBOT_SERVER_USETLS=True diff --git a/src/ircbot/irc3module.py b/src/ircbot/irc3module.py index 5e3a7b0d..0fe35995 100644 --- a/src/ircbot/irc3module.py +++ b/src/ircbot/irc3module.py @@ -59,6 +59,14 @@ class Plugin(object): def on_kick(self, **kwargs): 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