Skip to content

Commit

Permalink
few fixes after migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
ychebyshev committed Jan 4, 2024
1 parent a9b65b7 commit 278f854
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 12 deletions.
1 change: 0 additions & 1 deletion app/config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
),
Expand Down
10 changes: 1 addition & 9 deletions app/handlers/superuser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand All @@ -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="!/")
)
Expand Down
1 change: 0 additions & 1 deletion app/models/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 278f854

Please sign in to comment.