Добавлены новые методы для получения статистики постов пользователей, информации о последних постах и количестве банов. Обновлены запросы в репозиториях для сортировки пользователей по дате бана. Исправлены вызовы функций форматирования сообщений для администраторов. Обновлены тесты для проверки новых функциональностей.
This commit is contained in:
@@ -8,7 +8,7 @@ from aiogram.types import CallbackQuery
|
||||
from helper_bot.keyboards.keyboards import create_keyboard_for_ban_reason
|
||||
from helper_bot.utils.helper_func import (
|
||||
delete_user_blacklist,
|
||||
get_text_message,
|
||||
get_publish_text,
|
||||
send_audio_message,
|
||||
send_media_group_to_channel,
|
||||
send_photo_message,
|
||||
@@ -137,7 +137,7 @@ class PostPublishService:
|
||||
raise PostNotFoundError(f"Пользователь {author_id} не найден в базе данных")
|
||||
|
||||
# Формируем финальный текст с учетом is_anonymous
|
||||
formatted_text = get_text_message(
|
||||
formatted_text = get_publish_text(
|
||||
raw_text, user.first_name, user.username, is_anonymous
|
||||
)
|
||||
|
||||
@@ -188,7 +188,7 @@ class PostPublishService:
|
||||
raise PostNotFoundError(f"Пользователь {author_id} не найден в базе данных")
|
||||
|
||||
# Формируем финальный текст с учетом is_anonymous
|
||||
formatted_text = get_text_message(
|
||||
formatted_text = get_publish_text(
|
||||
raw_text, user.first_name, user.username, is_anonymous
|
||||
)
|
||||
|
||||
@@ -247,7 +247,7 @@ class PostPublishService:
|
||||
raise PostNotFoundError(f"Пользователь {author_id} не найден в базе данных")
|
||||
|
||||
# Формируем финальный текст с учетом is_anonymous
|
||||
formatted_text = get_text_message(
|
||||
formatted_text = get_publish_text(
|
||||
raw_text, user.first_name, user.username, is_anonymous
|
||||
)
|
||||
|
||||
@@ -340,7 +340,7 @@ class PostPublishService:
|
||||
raise PostNotFoundError(f"Пользователь {author_id} не найден в базе данных")
|
||||
|
||||
# Формируем финальный текст с учетом is_anonymous
|
||||
formatted_text = get_text_message(
|
||||
formatted_text = get_publish_text(
|
||||
raw_text, user.first_name, user.username, is_anonymous
|
||||
)
|
||||
|
||||
@@ -452,7 +452,7 @@ class PostPublishService:
|
||||
f"Пользователь {author_id} не найден в базе данных"
|
||||
)
|
||||
|
||||
formatted_text = get_text_message(
|
||||
formatted_text = get_publish_text(
|
||||
raw_text, user.first_name, user.username, is_anonymous
|
||||
)
|
||||
|
||||
@@ -838,7 +838,7 @@ class BanService:
|
||||
await self.db.set_user_blacklist(
|
||||
user_id=author_id,
|
||||
user_name=None,
|
||||
message_for_user="Спам",
|
||||
message_for_user="Последний пост",
|
||||
date_to_unban=date_to_unban,
|
||||
ban_author=ban_author_id,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user