fix: исправить вызов метода get_tool() → get() в ToolsRegistry

- 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 <qwen-coder@alibabacloud.com>
This commit is contained in:
mirivlad 2026-02-25 13:39:18 +08:00
parent f559c83baa
commit b748ceefb7
2 changed files with 3 additions and 3 deletions

2
bot.py
View File

@ -1299,7 +1299,7 @@ async def post_init(application: Application):
await application.bot.set_my_commands(commands) await application.bot.set_my_commands(commands)
# Инициализация планировщика cron-задач # Инициализация планировщика cron-задач
cron_tool = tools_registry.get_tool('cron_tool') cron_tool = tools_registry.get('cron_tool')
if cron_tool: if cron_tool:
scheduler = init_scheduler(cron_tool, ai_agent, send_notification=send_cron_notification) scheduler = init_scheduler(cron_tool, ai_agent, send_notification=send_cron_notification)
await scheduler.start() await scheduler.start()

View File

@ -132,9 +132,9 @@ async def cron_command(update: Update, context: ContextTypes.DEFAULT_TYPE):
""" """
user_id = update.effective_user.id user_id = update.effective_user.id
args = context.args args = context.args
# Получаем cron инструмент # Получаем cron инструмент
cron_tool = tools_registry.get_tool('cron_tool') cron_tool = tools_registry.get('cron_tool')
if not cron_tool: if not cron_tool:
await update.message.reply_text("❌ Ошибка: cron инструмент не найден") await update.message.reply_text("❌ Ошибка: cron инструмент не найден")
return return