From 58357f2f8b111e684fa0ff999496840b154594b5 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 2 Oct 2024 05:03:08 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=81=D0=BB?= =?UTF-8?q?=D0=BE=D0=B3=D0=B0=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handlers/notifications.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/handlers/notifications.py b/handlers/notifications.py index ddf6e637..55b4210b 100644 --- a/handlers/notifications.py +++ b/handlers/notifications.py @@ -5,6 +5,7 @@ from aiogram import Bot, Router, types from aiogram.fsm.state import State, StatesGroup from aiogram.types import ( # Импортируем необходимые классы InlineKeyboardButton, InlineKeyboardMarkup) +from aiogram.filters import Command from bot import bot from config import DATABASE_URL, ADMIN_PASSWORD, ADMIN_USERNAME, ADMIN_ID @@ -89,7 +90,7 @@ async def notify_expiring_keys(bot: Bot): except Exception as e: print(f"Ошибка при отправке уведомлений: {e}") -@router.message(commands=['send_to_all']) +@router.message(Command('send_to_all')) async def send_message_to_all_clients(message: types.Message): # Проверяем, является ли отправитель администратором if message.from_user.id != ADMIN_ID: # Замените ADMIN_ID на ID вашего администратора