From ff58ead1bc5037d3114457d1d13e8d09223bada6 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Sat, 25 Jan 2020 19:20:05 +0100 Subject: [PATCH] simplify the key significantly --- distbot/bot/bot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/distbot/bot/bot.py b/distbot/bot/bot.py index 5258b77..7c7af7f 100644 --- a/distbot/bot/bot.py +++ b/distbot/bot/bot.py @@ -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 -- 2.39.2