From: Thorsten Date: Mon, 8 Mar 2021 21:36:03 +0000 (+0100) Subject: fix routing key (again?!) X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=b6c8d87dbe7f921135161ba18e9388c73baec82a;p=urlbot-v3.git fix routing key (again?!) --- diff --git a/distbot/bot/bot.py b/distbot/bot/bot.py index 8d1c42e..009a397 100644 --- a/distbot/bot/bot.py +++ b/distbot/bot/bot.py @@ -103,7 +103,7 @@ class Bot(slixmpp.ClientXMPP): def get_amqp_routing_key(nick, msg): # simplify the key significantly offset = 0 - key = shlex.split(re.sub(r'[^a-zäöüß0-9 "\'.]', '', msg["body"].lower())) + key = shlex.split(re.sub(r'[^a-zäöüß0-9 "\'.-]', '', msg["body"].lower())) if not key: # simple dots, smilies, emoji shit, pass through key = shlex.split(msg["body"].lower()) diff --git a/distbot/plugins/translation.py b/distbot/plugins/translation.py index a3c2d2d..69f8469 100644 --- a/distbot/plugins/translation.py +++ b/distbot/plugins/translation.py @@ -521,6 +521,7 @@ class Translator(Worker): } result = requests.post('http://ws.detectlanguage.com/0.2/detect', data=data).json() educated_guess = result['data']['detections'][0] + logger.info("detected language: %s", str(educated_guess)) if not educated_guess['isReliable']: return Action(msg='not sure about the language.') else: