added sending logs to the admin chat
This commit is contained in:
@ -5,6 +5,8 @@ import logging
|
||||
import time
|
||||
from database import db
|
||||
|
||||
from action_reporter import action_reporter
|
||||
|
||||
from config import COMMAND_MESSAGES
|
||||
|
||||
logger = logging.getLogger(__name__) # Получаем логгер для текущего модуля
|
||||
@ -195,8 +197,7 @@ def register_handlers(bot: AsyncTeleBot): # Регистрирует все об
|
||||
identifier = parts_msg[1].strip()
|
||||
time_arg = parts_msg[2]
|
||||
reason = extract_reason(parts_msg[3:])
|
||||
print(identifier)
|
||||
|
||||
|
||||
# Поиск по ID
|
||||
if identifier.isdigit():
|
||||
|
||||
@ -343,6 +344,15 @@ def register_handlers(bot: AsyncTeleBot): # Регистрирует все об
|
||||
# Форматирование времени
|
||||
time_display = format_time(mute_seconds)
|
||||
|
||||
# Отправляем лог в админ-чат
|
||||
await action_reporter.log_action(
|
||||
action="МУТ",
|
||||
user_id=target_user.id,
|
||||
admin_id=message.from_user.id,
|
||||
reason=reason,
|
||||
duration=time_display
|
||||
)
|
||||
|
||||
# Отправляем сообщения, что пользователь получил мут
|
||||
await send_message(chat_id, COMMAND_MESSAGES['muted'].format(time_display=time_display))
|
||||
logger.info(f"Пользователь {target_user.id} получил мут на {time_display} от администратора {message.from_user.id}.")
|
||||
|
Reference in New Issue
Block a user