diff --git a/config.py b/config.py index 9efe429..425d111 100644 --- a/config.py +++ b/config.py @@ -1 +1,21 @@ -BOT_TOKEN = "7548174804:AAF3da0PZR47RzOF4llQEJszMD5JjVdS8zI" \ No newline at end of file +import json +from telegram import BotCommand + +ACCESS_FILE = "./data/config.json" + +def load_config(): + try: + with open(ACCESS_FILE, "r") as f: + return json.load(f) + except FileNotFoundError: + return {} + +def get_bot_token(bot_name): + config = load_config().get(str(bot_name), {}) + return config.get("token", "") + +def get_commands(bot_name): + config = load_config().get(str(bot_name), {}) + commands = config.get("commands", {}) + bot_commands = [] + return [BotCommand(command, description) for command, description in commands.items()] \ No newline at end of file