From b748ceefb74c78d375dc57caddbc2ef25a11a5e9 Mon Sep 17 00:00:00 2001 From: mirivlad Date: Wed, 25 Feb 2026 13:39:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D1=82=D1=8C=20=D0=B2=D1=8B=D0=B7=D0=BE=D0=B2=20=D0=BC?= =?UTF-8?q?=D0=B5=D1=82=D0=BE=D0=B4=D0=B0=20get=5Ftool()=20=E2=86=92=20get?= =?UTF-8?q?()=20=D0=B2=20ToolsRegistry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - bot.py: исправить tools_registry.get_tool() на tools_registry.get() - bot/handlers/commands.py: исправить tools_registry.get_tool() на tools_registry.get() Исправляет ошибку AttributeError при запуске бота Co-authored-by: Qwen-Coder --- bot.py | 2 +- bot/handlers/commands.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index 3859daf..4afeece 100644 --- a/bot.py +++ b/bot.py @@ -1299,7 +1299,7 @@ async def post_init(application: Application): await application.bot.set_my_commands(commands) # Инициализация планировщика cron-задач - cron_tool = tools_registry.get_tool('cron_tool') + cron_tool = tools_registry.get('cron_tool') if cron_tool: scheduler = init_scheduler(cron_tool, ai_agent, send_notification=send_cron_notification) await scheduler.start() diff --git a/bot/handlers/commands.py b/bot/handlers/commands.py index 1b3d2d0..105c0ca 100644 --- a/bot/handlers/commands.py +++ b/bot/handlers/commands.py @@ -132,9 +132,9 @@ async def cron_command(update: Update, context: ContextTypes.DEFAULT_TYPE): """ user_id = update.effective_user.id args = context.args - + # Получаем cron инструмент - cron_tool = tools_registry.get_tool('cron_tool') + cron_tool = tools_registry.get('cron_tool') if not cron_tool: await update.message.reply_text("❌ Ошибка: cron инструмент не найден") return