From 9e8df0ecc0dbb2f1155e223095127187f9035a3e Mon Sep 17 00:00:00 2001 From: Sebastian Gehaxelt Date: Sun, 3 Feb 2019 22:08:37 +0100 Subject: [PATCH] Add the possibility to authenticate against NickServer --- bot.py | 3 +++ config.py.sample | 1 + 2 files changed, 4 insertions(+) diff --git a/bot.py b/bot.py index 7cd1ad2..8455a7c 100644 --- a/bot.py +++ b/bot.py @@ -44,6 +44,9 @@ def on_kick(self, connection, event): connection.join(self.__config.CHANNEL) def on_welcome(self, connection, event): + """Authenticate using NickServ""" + if self.__config.NICKPASS: + self.connection.privmsg("NickServ", "IDENTIFY {}".format(self.__config.NICKPASS)) """Join the correct channel upon connecting""" if irc.client.is_channel(self.__config.CHANNEL): connection.join(self.__config.CHANNEL) diff --git a/config.py.sample b/config.py.sample index f33e878..28f13ca 100644 --- a/config.py.sample +++ b/config.py.sample @@ -9,6 +9,7 @@ class Config(object): self.SSL = False self.CHANNEL = "##YOURCHANNEL" self.NICK = "YOURBOTNICK" + self.NICKPASS = "YOURPASSWORD" self.admin_nicks= ['YOURADMINNICK'] #=Colours= #1 - red 2 - green 3 - yellow