fix sed command for real now

This commit is contained in:
Kyle Czar 2024-02-21 16:40:07 -03:00
commit 5c4e9067a0

View file

@ -218,7 +218,7 @@ class AngelBot(ClientXMPP):
"""Process sed command."""
try:
text = msg["body"]
if not sed_cmd.search(text):
if not sed_cmd.match(text):
self.messages[sender]["messages"].add(text)
return
sed_args = sed_parse.split(text)
@ -230,7 +230,7 @@ class AngelBot(ClientXMPP):
sed.load_string(text)
for message in self.messages[sender]["messages"]:
if not re.match(sed_args[1], message):
if not re.search(sed_args[1], message):
continue
msg = io.StringIO(message)
res = "\n".join(sed.apply(msg, None))