From c75ec0b22a3f674d3e1a24b9d546eca1998701b3 Mon Sep 17 00:00:00 2001 From: Fringg Date: Tue, 17 Feb 2026 05:23:49 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20AttributeError=20in=20withdrawal=20admin?= =?UTF-8?q?=20notification=20(send=5Fto=5Fadmins=20=E2=86=92=20send=5Fadmi?= =?UTF-8?q?n=5Fnotification)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/handlers/referral.py | 2 +- app/services/admin_notification_service.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/handlers/referral.py b/app/handlers/referral.py index 50701f7c..7f667cfa 100644 --- a/app/handlers/referral.py +++ b/app/handlers/referral.py @@ -793,7 +793,7 @@ async def confirm_withdrawal_request(callback: types.CallbackQuery, db_user: Use try: notification_service = AdminNotificationService(callback.bot) - await notification_service.send_to_admins(admin_text, keyboard=admin_keyboard) + await notification_service.send_admin_notification(admin_text, reply_markup=admin_keyboard) except Exception as e: logger.error('Ошибка отправки уведомления админам о заявке на вывод', error=e) diff --git a/app/services/admin_notification_service.py b/app/services/admin_notification_service.py index c975b171..5d73fec4 100644 --- a/app/services/admin_notification_service.py +++ b/app/services/admin_notification_service.py @@ -1215,6 +1215,14 @@ class AdminNotificationService: """Public check for whether admin notifications are configured and active.""" return self._is_enabled() + async def send_admin_notification( + self, text: str, reply_markup: types.InlineKeyboardMarkup | None = None + ) -> bool: + """Send a generic notification to admin chat with optional inline keyboard.""" + if not self._is_enabled(): + return False + return await self._send_message(text, reply_markup=reply_markup) + async def send_webhook_notification(self, text: str) -> bool: """Send a generic webhook/infrastructure notification to admin chat.