From 9a7652cb9b61403088b540fab5778703e0b8fe7b Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Mon, 4 Jan 2016 03:43:50 -0500 Subject: [PATCH] Bugfix for alternate PRIVMSG/NOTICE format. --- earwigbot/irc/data.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/earwigbot/irc/data.py b/earwigbot/irc/data.py index 06c8d5d..eaffed0 100644 --- a/earwigbot/irc/data.py +++ b/earwigbot/irc/data.py @@ -50,10 +50,15 @@ class Data(object): def _parse(self): """Parse a line from IRC into its components as instance attributes.""" - sender = re.findall(r":(.*?)!(.*?)@(.*?)\Z", self.line[0])[0] + self._chan = self.line[2] + try: + sender = re.findall(r":(.*?)!(.*?)@(.*?)\Z", self.line[0])[0] + except IndexError: + self._host = self.line[0][1:] + self._nick = self._ident = self._reply_nick = "*" + return self._nick, self._ident, self._host = sender self._reply_nick = self._nick - self._chan = self.line[2] if self._msgtype in ["PRIVMSG", "NOTICE"]: if self.chan.lower() == self.my_nick: