]> PatchyGit - angel.git/commitdiff
check if sed message matches with regex
authorKaio Cesar <kaio@artnew.com.br>
Mon, 8 Jan 2024 18:53:50 +0000 (15:53 -0300)
committerKaio Cesar <kaio@artnew.com.br>
Mon, 8 Jan 2024 18:53:50 +0000 (15:53 -0300)
closes #10

.gitignore
main.py

index 55247bc..8cd0f88 100644 (file)
@@ -1,2 +1,3 @@
 config.ini
 PythonSed
+*#*
\ No newline at end of file
diff --git a/main.py b/main.py
index 319dba5..9f69ee8 100644 (file)
--- a/main.py
+++ b/main.py
@@ -229,7 +229,7 @@ class AngelBot(ClientXMPP):
             sed.load_string(text)\r
 \r
             for message in self.messages[sender]["messages"]:\r
-                if sed_args[1] not in message:\r
+                if not re.match(sed_args[1], message):\r
                     continue\r
                 msg = io.StringIO(message)\r
                 res = "\n".join(sed.apply(msg, None))\r