]> jfr.im git - erebus.git/commitdiff
fix subtext thinking random lines are for it
authorzonidjan <redacted>
Fri, 6 Sep 2019 15:35:19 +0000 (10:35 -0500)
committerzonidjan <redacted>
Fri, 6 Sep 2019 15:35:19 +0000 (10:35 -0500)
like "spongebob squarepants"

modules/subtext.py

index 894c3f847d221c5c22d3c39d8a6e062471f5c6c2..88a2368e5747dc37f705f9938e10338f5587db86 100644 (file)
@@ -23,7 +23,7 @@ modstop = lib.modstop
 # module code
 import re
 from collections import namedtuple
-re_findsub = re.compile(r"s(.)(?P<search>.+?)\1(?P<replace>.+?)(?:\1(?P<global>g)?|$)")
+re_findsub = re.compile(r"""s([/'";:!@#$%^&-_=`~])(?P<search>.+?)\1(?P<replace>.+?)(?:\1(?P<global>g)?|$)""")
 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: