From d8b83100b6c28c1b896a7f4dc1bc88daa76de2a7 Mon Sep 17 00:00:00 2001 From: dymik739 Date: Tue, 15 Sep 2026 11:29:31 +0300 Subject: [PATCH] retire unused module translator --- modules/translator/index.py | 34 --------------------------------- modules/translator/meta.json | 7 ------- modules/translator/predefine.py | 1 - 3 files changed, 42 deletions(-) delete mode 100644 modules/translator/index.py delete mode 100644 modules/translator/meta.json delete mode 100644 modules/translator/predefine.py diff --git a/modules/translator/index.py b/modules/translator/index.py deleted file mode 100644 index d9a7104..0000000 --- a/modules/translator/index.py +++ /dev/null @@ -1,34 +0,0 @@ -command = self.MESSAGE['text'].split(" ", 2) -command_length = len(command) - -if (command[0] in self.aliases) and (1 <= command_length <= 3): - try: - import requests - - if command_length == 1: - chosen_model = "auto-uk" - else: - chosen_model = command[1] - - source, target = chosen_model.split("-") - - if command_length == 3: - text_to_translate = command[2] - else: - text_to_translate = self.MESSAGE['reply_to_message']['text'] - - data = {"q": text_to_translate, - "source": source, - "target": target, - "format": "text"} - - res = requests.post("http://10.1.1.1:5010/translate", data = data) - result = json.loads(res.text) - - if source == "auto": - self.RESPONSE = f"Результат ({result['detectedLanguage']['language']} - {result['detectedLanguage']['confidence']}%): {result['translatedText']}" - else: - self.RESPONSE = f"Результат: {result['translatedText']}" - - except Exception as e: - print(f"[translit-decoder] Got exception: {e}") diff --git a/modules/translator/meta.json b/modules/translator/meta.json deleted file mode 100644 index a39b8fa..0000000 --- a/modules/translator/meta.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 1, - "index_file": "index.py", - "start_on_boot": false, - "alias": "translator", - "predefine": "predefine.py" -} diff --git a/modules/translator/predefine.py b/modules/translator/predefine.py deleted file mode 100644 index 7cd4b2e..0000000 --- a/modules/translator/predefine.py +++ /dev/null @@ -1 +0,0 @@ -self.aliases = ["!translate", "!t"]