Skip to content

Commit cbcd1c7

Browse files
CopilotBukeLy
andcommitted
fix: await telegram local command replies
Co-authored-by: BukeLy <19304666+BukeLy@users.noreply.github.com>
1 parent b053a71 commit cbcd1c7

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

agent-sdk-client/handler.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
Receives Telegram webhook, writes to SQS, returns 200 immediately.
44
"""
5+
import asyncio
56
import json
67
import logging
78
from typing import Any
@@ -128,11 +129,13 @@ def _handle_local_command(bot: Bot, message, config: Config, cmd: str) -> bool:
128129
text = config.unknown_command_message()
129130

130131
try:
131-
bot.send_message(
132-
chat_id=message.chat_id,
133-
text=text,
134-
message_thread_id=message.message_thread_id,
135-
reply_to_message_id=message.message_id,
132+
asyncio.run(
133+
bot.send_message(
134+
chat_id=message.chat_id,
135+
text=text,
136+
message_thread_id=message.message_thread_id,
137+
reply_to_message_id=message.message_id,
138+
)
136139
)
137140
except Exception:
138141
logger.warning("Failed to send local command response", exc_info=True)

0 commit comments

Comments
 (0)