From: John Runyon Date: Sun, 10 Mar 2024 13:00:34 +0000 (-0600) Subject: sockets - use channel's bot if on channel X-Git-Url: https://jfr.im/git/erebus.git/commitdiff_plain/33af27c632e4227f266466ffd26260986cfcc5f7 sockets - use channel's bot if on channel --- diff --git a/modules/sockets.py b/modules/sockets.py index 060057b..cf79e70 100644 --- a/modules/sockets.py +++ b/modules/sockets.py @@ -57,7 +57,10 @@ def gotParent(parent): return lines def parse(self, line): - bot = lib.parent.randbot() + try: + bot = lib.parent.channel(self.chan).bot + except AttributeError: # 'NoneType' object has no attribute 'bot' + bot = lib.parent.randbot() maxlen = bot.maxmsglen() - len("PRIVMSG :") - len(self.chan) while len(line) > maxlen: cutat = line.rfind(' ', 0, maxlen)