added sending logs to the admin chat

This commit is contained in:
2025-07-16 10:28:42 +03:00
parent fc3ef20145
commit 40b60baa93
8 changed files with 136 additions and 6 deletions

View File

@ -4,6 +4,8 @@ import asyncio
import logging
from database import db
from action_reporter import action_reporter
from config import COMMAND_MESSAGES
logger = logging.getLogger(__name__) # Получаем логгер для текущего модуля
@ -143,6 +145,15 @@ def register_handlers(bot: AsyncTeleBot): # Регистрирует все об
# Выполняем разбан
try:
await bot.unban_chat_member(message.chat.id, target_user.id)
# Отправляем лог в админ-чат
await action_reporter.log_action(
action="РАЗБАН",
user_id=target_user.id,
admin_id=message.from_user.id,
reason=None,
duration=None
)
# Отправляем сообщения, что пользователь получил разбан
await send_message(chat_id, COMMAND_MESSAGES['unbanned'])