From 278f854875d3960e9683bd33243a3fded4b545d3 Mon Sep 17 00:00:00 2001 From: ychebyshev Date: Thu, 4 Jan 2024 23:29:18 +0300 Subject: [PATCH] few fixes after migrations --- app/config/main.py | 1 - app/handlers/superuser.py | 10 +--------- app/models/config/__init__.py | 1 - docker-compose.yaml | 2 +- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/app/config/main.py b/app/config/main.py index 936d67ec..91069a28 100644 --- a/app/config/main.py +++ b/app/config/main.py @@ -40,7 +40,6 @@ def load_config(config_dir: Path = None) -> Config: bot_token=_bot_token, superusers=frozenset(config_file_data["superusers"]), log=log_config, - dump_chat_id=config_file_data["dump_chat_id"], tg_client=load_tg_client_config( config_file_data["tg_client_config"] | {"bot_token": _bot_token} ), diff --git a/app/handlers/superuser.py b/app/handlers/superuser.py index ee86debb..e84df211 100644 --- a/app/handlers/superuser.py +++ b/app/handlers/superuser.py @@ -3,7 +3,7 @@ from aiogram import Bot, Router from aiogram.filters import Command -from aiogram.types import BufferedInputFile, Message +from aiogram.types import Message from app.models.config import Config @@ -20,13 +20,6 @@ async def leave_chat(message: Message, bot: Bot): await bot.leave_chat(message.chat.id) -async def get_dump(_: Message, config: Config, bot: Bot): - with open(config.db.db_path, "rb") as f: - await bot.send_document( - config.dump_chat_id, BufferedInputFile(f.read(), "karma.db") - ) - - async def show_tagged_users(message: Message): result = "" for e in message.reply_to_message.entities: @@ -44,7 +37,6 @@ def setup_superuser(bot_config: Config) -> Router: router.message.register(exception, Command(commands="exception")) router.message.register(leave_chat, Command(commands="get_out")) - router.message.register(get_dump, Command(commands="dump")) router.message.register( show_tagged_users, Command(commands="entities", prefix="!/") ) diff --git a/app/models/config/__init__.py b/app/models/config/__init__.py index 566f2f52..d7bbb7e0 100644 --- a/app/models/config/__init__.py +++ b/app/models/config/__init__.py @@ -19,7 +19,6 @@ class Config: bot_token: str superusers: Iterable[int] log: LogConfig - dump_chat_id: int tg_client: TgClientConfig storage: StorageConfig date_format: str = "%d.%m.%Y" diff --git a/docker-compose.yaml b/docker-compose.yaml index e675e87a..e0ade87f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -29,7 +29,7 @@ services: POSTGRES_USER: $POSTGRES_USER POSTGRES_DB: $POSTGRES_DB volumes: - - postgres.data:/var/lib/postgresql/users:rw + - postgres.data:/var/lib/postgresql/data:rw healthcheck: test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"] interval: 10s