]> git.aero2k.de Git - urlbot-v3.git/commitdiff
simplify the key significantly
authorThorsten <mail@aero2k.de>
Sat, 25 Jan 2020 18:20:05 +0000 (19:20 +0100)
committerThorsten <mail@aero2k.de>
Sat, 25 Jan 2020 18:20:05 +0000 (19:20 +0100)
distbot/bot/bot.py

index 5258b771bdfe0600afaa655f863275154bb5917b..7c7af7f130c4a87392dfdeb3c426ef640c441b43 100644 (file)
@@ -1,6 +1,7 @@
 # -*- coding: utf-8 -*-
 import json
 import logging
+import re
 import shlex
 
 import pika
@@ -122,7 +123,8 @@ class Bot(sleekxmpp.ClientXMPP):
                 self.initialize_actionthreads()
                 self.echo("Worker One available for master.")
 
-            key = shlex.split(msg["body"].lower())
+            # simplify the key significantly
+            key = shlex.split(re.sub(r'[^a-z0-9 "\']', '', msg["body"].lower()))
 
             # cut the nick from the message
             offset = 0