Множественные мелкие исправления

This commit is contained in:
armatik 2024-05-01 01:50:18 +03:00
parent 661209055d
commit 85a357e37b
6 changed files with 457 additions and 447 deletions

View File

@ -11,5 +11,5 @@ json = {
'modules standard': str(dir_modules_standard), 'modules standard': str(dir_modules_standard),
'modules custom': str(dir_modules_custom), 'modules custom': str(dir_modules_custom),
} }
with open("paths.json", "w", encoding="utf8") as f: with open("src/paths.json", "w", encoding="utf8") as f:
f.write(dumps(json, indent=4)) f.write(dumps(json, indent=4))

890
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,7 @@
from aiogram import Dispatcher from aiogram import Dispatcher
from src.modules.standard.admin.routers import router as admin_router from src.modules.standard.admin.routers import router as admin_router
from src.modules.external.yandexgpt.routers import router as yandexgpt_router
async def include_routers(dp: Dispatcher): async def include_routers(dp: Dispatcher):
@ -8,4 +9,5 @@ async def include_routers(dp: Dispatcher):
Подключение роутеров в бота Подключение роутеров в бота
dp.include_router() dp.include_router()
""" """
dp.include_router(yandexgpt_router)
dp.include_router(admin_router) dp.include_router(admin_router)

View File

@ -18,13 +18,13 @@ def get_telegram_token() -> str:
return config["TELEGRAM"]["TOKEN"] return config["TELEGRAM"]["TOKEN"]
def get_yandexgpt_token() -> str: def get_yandexgpt_token() -> str:
return config["YANDEX_GPT_TOKEN"] return config["YANDEXGPT"]["TOKEN"]
def get_yandexgpt_catalog_id() -> str: def get_yandexgpt_catalog_id() -> str:
return config["YANDEX_GPT_CATALOG_ID"] return config["YANDEXGPT"]["CATALOGID"]
def get_yandexgpt_prompt() -> str: def get_yandexgpt_prompt() -> str:
return config["YANDEX_GPT_PROMPT"] return config["YANDEXGPT"]["PROMPT"]
def get_access_rights() -> dict: def get_access_rights() -> dict:
return get_config()["ACCESS_RIGHTS"] return get_config()["ACCESS_RIGHTS"]

View File

@ -2,7 +2,7 @@ from aiogram.filters import BaseFilter
from aiogram.types import Message from aiogram.types import Message
from aiogram import Bot from aiogram import Bot
from src.modules.standard.roles.api import Roles from src.modules.standard.roles.roles import Roles
class ChatModerOrAdminFilter(BaseFilter): class ChatModerOrAdminFilter(BaseFilter):
async def __call__(self, message: Message, bot: Bot) -> bool: async def __call__(self, message: Message, bot: Bot) -> bool:

View File

@ -20,6 +20,6 @@ def _get_paths(path_to_json: str):
cwd = os.getcwd() cwd = os.getcwd()
cwd = cwd[:cwd.index('/src')] cwd = cwd + "/src"
paths = _get_paths(f"{cwd}/paths.json") paths = _get_paths(f"{cwd}/paths.json")