add nickserv functionality

This commit is contained in:
Thomas Steen Rasmussen 2017-07-03 21:08:47 +02:00
parent 79cd7d73c4
commit 205e112718
2 changed files with 9 additions and 0 deletions

View file

@ -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

View file

@ -59,6 +59,14 @@ class Plugin(object):
def on_kick(self, **kwargs):
logger.debug("inside on_kick(), kwargs: %s" % kwargs)
@irc3.event(r'(@(?P<tags>\S+) )?:(?P<ns>NickServ)!NickServ@services.baconsvin.org' r' NOTICE (?P<nick>irc3) :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