added sending logs to the admin chat
This commit is contained in:
@ -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'])
|
||||
|
Reference in New Issue
Block a user