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:
parent
f559c83baa
commit
b748ceefb7
2
bot.py
2
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()
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue