Refactor imports across multiple files to improve code organization and readability.
All checks were successful
CI pipeline / Test & Code Quality (push) Successful in 34s
All checks were successful
CI pipeline / Test & Code Quality (push) Successful in 34s
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from aiogram import F, Router, types
|
||||
from aiogram.filters import Command, MagicData, StateFilter
|
||||
from aiogram.fsm.context import FSMContext
|
||||
|
||||
from helper_bot.filters.main import ChatTypeFilter
|
||||
from helper_bot.handlers.admin.dependencies import AdminAccessMiddleware
|
||||
from helper_bot.handlers.admin.exceptions import (
|
||||
@@ -138,7 +139,9 @@ async def get_banned_users(
|
||||
keyboard = create_keyboard_with_pagination(
|
||||
1, len(buttons_list), buttons_list, "unlock"
|
||||
)
|
||||
await message.answer(text=message_text, reply_markup=keyboard, parse_mode="HTML")
|
||||
await message.answer(
|
||||
text=message_text, reply_markup=keyboard, parse_mode="HTML"
|
||||
)
|
||||
else:
|
||||
await message.answer(
|
||||
text="В списке заблокированных пользователей никого нет"
|
||||
@@ -217,12 +220,8 @@ async def get_ml_stats(message: types.Message, state: FSMContext, **kwargs):
|
||||
lines.append(f" • API URL: {rag.get('api_url', 'N/A')}")
|
||||
if "enabled" in rag:
|
||||
if rag.get("enabled"):
|
||||
lines.append(
|
||||
f" • Статус: ⚠️ Включен, но API не отвечает"
|
||||
)
|
||||
lines.append(
|
||||
f" • Проверьте доступность сервиса и API ключ"
|
||||
)
|
||||
lines.append(f" • Статус: ⚠️ Включен, но API не отвечает")
|
||||
lines.append(f" • Проверьте доступность сервиса и API ключ")
|
||||
else:
|
||||
lines.append(f" • Статус: ❌ Отключен")
|
||||
|
||||
@@ -460,8 +459,7 @@ async def process_publish_threshold(
|
||||
|
||||
except ValueError as e:
|
||||
await message.answer(
|
||||
f"❌ Неверное значение: {e}\n"
|
||||
"Введите число от 0.0 до 1.0 (например: 0.8)"
|
||||
f"❌ Неверное значение: {e}\n" "Введите число от 0.0 до 1.0 (например: 0.8)"
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"Ошибка изменения порога публикации: {e}")
|
||||
@@ -503,8 +501,7 @@ async def process_decline_threshold(
|
||||
|
||||
except ValueError as e:
|
||||
await message.answer(
|
||||
f"❌ Неверное значение: {e}\n"
|
||||
"Введите число от 0.0 до 1.0 (например: 0.4)"
|
||||
f"❌ Неверное значение: {e}\n" "Введите число от 0.0 до 1.0 (например: 0.4)"
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"Ошибка изменения порога отклонения: {e}")
|
||||
|
||||
@@ -7,6 +7,7 @@ except ImportError:
|
||||
|
||||
from aiogram import BaseMiddleware
|
||||
from aiogram.types import TelegramObject
|
||||
|
||||
from helper_bot.utils.base_dependency_factory import get_global_instance
|
||||
from helper_bot.utils.helper_func import check_access
|
||||
from logs.custom_logger import logger
|
||||
|
||||
@@ -6,6 +6,7 @@ from aiogram import F, Router, types
|
||||
from aiogram.filters import Command, MagicData
|
||||
from aiogram.fsm.context import FSMContext
|
||||
from aiogram.types import FSInputFile
|
||||
|
||||
from helper_bot.filters.main import ChatTypeFilter
|
||||
from helper_bot.middlewares.dependencies_middleware import DependenciesMiddleware
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ from typing import Optional
|
||||
|
||||
from aiogram import types
|
||||
from aiogram.fsm.context import FSMContext
|
||||
|
||||
from helper_bot.handlers.admin.exceptions import AdminError
|
||||
from helper_bot.keyboards.keyboards import get_reply_keyboard_admin
|
||||
from logs.custom_logger import logger
|
||||
|
||||
Reference in New Issue
Block a user