Handle quotation marks properly

master
Nikola Forró 7 years ago
parent e70e221ea6
commit 19209f1f76

@ -24,7 +24,7 @@ QUOTE_ADDED_PATTERN = re.compile(r'''^
(?P<user>.+)\s+-->\s+
Sweet!\s+Thanks\s+for\s+the\s+quote!\s+
\#(?P<id>\d+):\s+
"(?P<text>.+)"\s+
(?P<text>.+)\s+
\[(?P<game>.+)\]\s+
\[(?P<date>.+)\]$''', 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(

Loading…
Cancel
Save