From 68196bf9a565db9b3a15ab25cd8a68025ee7d71c Mon Sep 17 00:00:00 2001 From: HypoxiE Date: Thu, 21 Aug 2025 15:35:15 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libs/tokens_formatter.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/libs/tokens_formatter.py b/src/libs/tokens_formatter.py index 5b8c3aa..f7f12ad 100644 --- a/src/libs/tokens_formatter.py +++ b/src/libs/tokens_formatter.py @@ -1,14 +1,16 @@ +import os TOKENS: dict[str, str] = {} -with open("secrets/TOKEN_KrekAdminBot.txt") as file: - TOKENS = {'KrekAdminBot': file.read()} +token_files = { + 'KrekAdminBot': "secrets/TOKEN_KrekAdminBot.txt", + 'KrekFunBot': "secrets/TOKEN_KrekFunBot.txt", + 'KrekRimagochiBot': "secrets/TOKEN_KrekRimagochiBot.txt", + 'KrekSupBot': "secrets/TOKEN_KrekSupBot.txt", + 'KrekModBot': "secrets/TOKEN_KrekModBot.txt" +} -with open("secrets/TOKEN_KrekFunBot.txt") as file: - TOKENS = {'KrekFunBot': file.read()} - -with open("secrets/TOKEN_KrekRimagochiBot.txt") as file: - TOKENS = {'KrekRimagochiBot': file.read()} - -with open("secrets/TOKEN_KrekSupBot.txt") as file: - TOKENS = {'KrekSupBot': file.read()} \ No newline at end of file +for bot, path in token_files.items(): + if os.path.exists(path): + with open(path, "r") as file: + TOKENS = {bot: file.read()} \ No newline at end of file