Telegram bot keeps repeating identical voice message continuously

My telegram bot was functioning perfectly until I accidentally sent an audio message. Now it’s completely broken and won’t process new messages.

When I look at the server logs, I notice the bot keeps receiving the exact same voice message over and over with identical message_id. It’s like it’s stuck processing this one audio file instead of handling new text messages.

Here’s what the repeated payload looks like:

{
  "update_id": 845332189,
  "message": {
    "message_id": 42,
    "from": {
      "id": 5527841663,
      "is_bot": false,
      "first_name": "John",
      "last_name": "Smith",
      "language_code": "en"
    },
    "chat": {
      "id": 5527841663,
      "first_name": "John",
      "last_name": "Smith",
      "type": "private"
    },
    "date": 1710925847,
    "voice": {
      "duration": 5,
      "mime_type": "audio/ogg",
      "file_id": "BwACAgUAAxkBAAMcZgpnX8QxpSO4hVUl7Y-3JLsVS_mAAsdRABJqzuCYzV36q8bEfpN1BE",
      "file_unique_id": "AgADxxRABGrO4Jg",
      "file_size": 87219
    }
  }
}

How can I fix this loop and make my bot start accepting fresh messages again?

Same thing happened to me last week! Telegram keeps resending because your bot didn’t confirm it received the voice message. If you’re using webhooks, return HTTP 200 even for voice messages you don’t handle. Otherwise the update stays queued and loops forever. Try restarting your bot after manually skipping that update_id.

Had this exact problem six months ago - drove me nuts for hours. Your bot isn’t acknowledging the voice message properly, so Telegram keeps resending it thinking it wasn’t processed. Check your webhook response or getUpdates offset handling. If you’re using webhooks, return a 200 status code even for voice messages you can’t process. For polling with getUpdates, make sure you’re incrementing the offset correctly to move past the stuck update. Quick fix: manually set your offset higher than the problematic update_id (845332189 in your case). Call getUpdates with offset=845332190 and it’ll skip the stuck message and get things working again.

Had the exact same issue when I messed up voice message handling in my bot. Your bot keeps getting the same update because Telegram thinks you never processed it properly. With getUpdates, you must confirm each update by setting the offset parameter to update_id + 1. Since you’re stuck on 845332189, call getUpdates with offset=845332190. This skips the problematic voice message and moves on to newer updates. Pro tip: make your bot handle voice messages gracefully even if it doesn’t actually process them - just acknowledge and continue.