diff --git a/agent-sdk-client/handler.py b/agent-sdk-client/handler.py index ae3cd9f..f472583 100644 --- a/agent-sdk-client/handler.py +++ b/agent-sdk-client/handler.py @@ -2,6 +2,7 @@ Receives Telegram webhook, writes to SQS, returns 200 immediately. """ +import asyncio import json import logging from typing import Any @@ -128,11 +129,13 @@ def _handle_local_command(bot: Bot, message, config: Config, cmd: str) -> bool: text = config.unknown_command_message() try: - bot.send_message( - chat_id=message.chat_id, - text=text, - message_thread_id=message.message_thread_id, - reply_to_message_id=message.message_id, + asyncio.run( + bot.send_message( + chat_id=message.chat_id, + text=text, + message_thread_id=message.message_thread_id, + reply_to_message_id=message.message_id, + ) ) except Exception: logger.warning("Failed to send local command response", exc_info=True)