Skip to content

Commit ba369a3

Browse files
committed
fix(telegram_send): handle 400 error by retrying without reply_to_message_id
Signed-off-by: Frost Ming <me@frostming.com>
1 parent 450549d commit ba369a3

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/bub/skills/telegram/scripts/telegram_send.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ def send_message(
114114
payload["reply_to_message_id"] = reply_to_message_id
115115

116116
response = requests.post(url, json=payload, timeout=30)
117+
if response.status_code == 400 and reply_to_message_id:
118+
payload.pop("reply_to_message_id", None)
119+
response = requests.post(url, json=payload, timeout=30)
117120
response.raise_for_status()
118121

119122
return response.json()

0 commit comments

Comments
 (0)