From: Thorsten Date: Sat, 25 Jan 2020 18:20:05 +0000 (+0100) Subject: simplify the key significantly X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=ff58ead1bc5037d3114457d1d13e8d09223bada6;p=urlbot-v3.git simplify the key significantly --- 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