From b6c8d87dbe7f921135161ba18e9388c73baec82a Mon Sep 17 00:00:00 2001 From: Thorsten Date: Mon, 8 Mar 2021 22:36:03 +0100 Subject: [PATCH] fix routing key (again?!) --- distbot/bot/bot.py | 2 +- distbot/plugins/translation.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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: -- 2.39.2