From 19209f1f76750813df9e239cfc5670abba9b9bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Mon, 30 Apr 2018 13:22:08 +0200 Subject: [PATCH] Handle quotation marks properly --- bot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 3440316..37604f3 100644 --- a/bot.py +++ b/bot.py @@ -24,7 +24,7 @@ QUOTE_ADDED_PATTERN = re.compile(r'''^ (?P.+)\s+-->\s+ Sweet!\s+Thanks\s+for\s+the\s+quote!\s+ \#(?P\d+):\s+ - "(?P.+)"\s+ + (?P.+)\s+ \[(?P.+)\]\s+ \[(?P.+)\]$''', re.VERBOSE) @@ -162,6 +162,8 @@ class TwitchBot(irc.bot.SingleServerIRCBot): connection.privmsg(self.channel, msg) def add_quote(self, connection, tags, user, id, text, game, date, **kwargs): + if text[0] == text[-1] == '"': + text = text[1:-1] log.info('Adding quote %s: %s', id, text) try: self.post(dict(