From f14f623fe18c6c8ce5a17daf94d14e9e4e1b0739 Mon Sep 17 00:00:00 2001 From: Choco <94597336+ChocoMeow@users.noreply.github.com> Date: Tue, 10 Dec 2024 10:16:57 +0800 Subject: [PATCH] Update main.py --- main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 59b52c3..511aa41 100644 --- a/main.py +++ b/main.py @@ -89,6 +89,9 @@ class Vocard(commands.Bot): # Connecting to MongoDB await self.connect_db() + # Set translator + await self.tree.set_translator(Translator()) + # Loading all the module in `cogs` folder for module in os.listdir(func.ROOT_DIR + '/cogs'): if module.endswith('.py'): @@ -106,11 +109,8 @@ class Vocard(commands.Bot): func.logger.error(f"Cannot connected to dashboard! - Reason: {e}") if not func.settings.version or func.settings.version != update.__version__: - func.update_json("settings.json", new_data={"version": update.__version__}) - - await self.tree.set_translator(Translator()) await self.tree.sync() - + func.update_json("settings.json", new_data={"version": update.__version__}) for locale_key, values in func.MISSING_TRANSLATOR.items(): func.logger.warning(f"Missing translation for '{", ".join(values)}' in '{locale_key}'")