Улучшена структура файла для более удобного добавления новых токенов

This commit is contained in:
2025-08-21 14:16:03 +07:00
parent 36a63edde8
commit 1bd1c0c1ca

View File

@@ -1,14 +1,16 @@
import os
TOKENS: dict[str, str] = {} TOKENS: dict[str, str] = {}
with open("secrets/TOKEN_KrekAdminBot.txt") as file: token_files = {
TOKENS = {'KrekAdminBot': file.read()} '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: for bot, path in token_files.items():
TOKENS = {'KrekFunBot': file.read()} if os.path.exists(path):
with open(path, "r") as file:
with open("secrets/TOKEN_KrekRimagochiBot.txt") as file: TOKENS = {bot: file.read()}
TOKENS = {'KrekRimagochiBot': file.read()}
with open("secrets/TOKEN_KrekSupBot.txt") as file:
TOKENS = {'KrekSupBot': file.read()}