mirror of
https://github.com/Noettore/lagomareGateKeeperBot.git
synced 2025-10-15 03:26:40 +02:00
21 lines
579 B
Python
21 lines
579 B
Python
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()] |