From: zonidjan Date: Fri, 6 Sep 2019 15:35:19 +0000 (-0500) Subject: fix subtext thinking random lines are for it X-Git-Url: https://jfr.im/git/erebus.git/commitdiff_plain/d57b4dceb90cf4872538b61a098b3ba769a56a5d fix subtext thinking random lines are for it like "spongebob squarepants" --- diff --git a/modules/subtext.py b/modules/subtext.py index 894c3f8..88a2368 100644 --- a/modules/subtext.py +++ b/modules/subtext.py @@ -23,7 +23,7 @@ modstop = lib.modstop # module code import re from collections import namedtuple -re_findsub = re.compile(r"s(.)(?P.+?)\1(?P.+?)(?:\1(?Pg)?|$)") +re_findsub = re.compile(r"""s([/'";:!@#$%^&-_=`~])(?P.+?)\1(?P.+?)(?:\1(?Pg)?|$)""") Line = namedtuple('Line', ['sender', 'msg']) lastline = {} @lib.hooknum("PRIVMSG") @@ -34,7 +34,6 @@ def privmsg_hook(bot, line): msg = pieces[3][1:] mo = re_findsub.match(msg) if mo: - bot.msg(chan, `mo.groups()`) if mo.group('global') is not None: count = 0 # unlimited else: