From: John Runyon Date: Wed, 28 Feb 2024 08:39:00 +0000 (-0700) Subject: add PASS support X-Git-Url: https://jfr.im/git/erebus.git/commitdiff_plain/a9c3376258b2ed65c1284ec4f0a45d685f647439 add PASS support --- diff --git a/bot.config.example b/bot.config.example index d65b693..933b34b 100644 --- a/bot.config.example +++ b/bot.config.example @@ -4,8 +4,10 @@ [erebus] realname = Erebus r1 + host = irc.quakenet.org port = 6667 +#pass = foobar dbhost = localhost dbuser = erebus diff --git a/bot.py b/bot.py index 73115a8..8b58d39 100644 --- a/bot.py +++ b/bot.py @@ -71,6 +71,7 @@ class Bot(object): def watchdog(self): if time.time() > int(self.parent.cfg.get('watchdog', 'maxtime', default=300))+self.lastreceived: self.parse("ERROR :Fake-error from watchdog timer.") + return if self.conn.registered(): self.conn.send("PING :%s" % (time.time())) self._checknick() @@ -556,6 +557,9 @@ class BotConnection(object): return True def register(self): if self.state == 0: + pss = self.parent.parent.cfg.get('erebus', 'pass') + if pss: + self.send("PASS %s" % (pss)) self.send("NICK %s" % (self.parent.nick)) self.send("USER %s 0 * :%s" % (self.parent.user, self.parent.realname)) self.state = 1