Refactor and start implementing inline keyboards

This commit is contained in:
2025-05-19 23:58:17 +02:00
parent 4a3d2746fb
commit 020b5e0193
7 changed files with 291 additions and 274 deletions

View File

@@ -2,18 +2,16 @@ import json
from telegram import BotCommand
class BotConfig:
def __init__(self, bot_username: str, json_path: str = "./data/config.json"):
self._json_path: str = json_path
self._bot_username: str = bot_username
self._json_path = json_path
self._bot_username = bot_username
self._token: str = ""
self._name: str = ""
self._description: str = ""
self._short_description: str = ""
self._commands: list[BotCommand] = []
self._load_config()
def _load_config(self):
try:
with open(self._json_path, "r") as f:
@@ -27,24 +25,24 @@ class BotConfig:
for command, description in config.get("commands", {}).items()
]
except Exception:
return {}
pass
@property
def token(self) -> str:
return self._token
@property
def name(self) -> str:
return self._name
@property
def description(self) -> str:
return self._description
@property
def short_description(self) -> str:
return self._short_description
@property
def commands(self) -> list[BotCommand]:
return self._commands