From 8d0f18c92916a5759e4ad7e68e69db50ecfc4ffc Mon Sep 17 00:00:00 2001 From: Capybara-z Date: Thu, 12 Feb 2026 20:19:19 +0300 Subject: [PATCH] fix middleware registration --- middlewares/__init__.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/middlewares/__init__.py b/middlewares/__init__.py index 18664bb3..b5a9271f 100644 --- a/middlewares/__init__.py +++ b/middlewares/__init__.py @@ -2,7 +2,6 @@ from collections.abc import Iterable from aiogram import BaseMiddleware, Dispatcher -from config import CHANNEL_REQUIRED, DISABLE_DIRECT_START from middlewares.ban_checker import BanCheckerMiddleware from middlewares.subscription import SubscriptionMiddleware @@ -38,11 +37,9 @@ def register_middleware( dispatcher.update.outer_middleware(wrap(ConcurrencyLimiterMiddleware(), "concurrency")) dispatcher.update.outer_middleware(wrap(SessionMiddleware(sessionmaker), "session")) - if DISABLE_DIRECT_START: - dispatcher.update.outer_middleware(wrap(DirectStartBlockerMiddleware(), "direct_start_blocker")) + dispatcher.update.outer_middleware(wrap(DirectStartBlockerMiddleware(), "direct_start_blocker")) - if CHANNEL_REQUIRED: - dispatcher.update.outer_middleware(wrap(SubscriptionMiddleware(), "subscription")) + dispatcher.update.outer_middleware(wrap(SubscriptionMiddleware(), "subscription")) dispatcher.update.outer_middleware(wrap(BanCheckerMiddleware(), "ban_checker"))