Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Telegram flood wait: what “A wait of X seconds is required” means, and how to stay under the limits

Description and use

Telegram returns a FLOOD_WAIT_X error requiring a pause. Scripts should read the specified time, pause the action, and reschedule to avoid repeated errors.

Problem

Telegram APIs return a FLOOD_WAIT_X error, causing scripts to pause or fail when sending messages or requests too frequently.

Outcome

By respecting the exact wait time specified in FLOOD_WAIT_X errors and rescheduling long waits, scripts avoid repeated retries, reduce overall wait time, and maintain compliance with Telegram’s rate limits.

Workflow

  • Read the error name and number (e.g., FLOOD_WAIT_X or retry_after).
  • Pause the failed action for the entire wait period; do not send test requests during this time.
  • If the wait is short, let the library sleep; if long, record the end time and reschedule the job.
  • After the wait, retry the request once; if waits recur, reduce request frequency.
  • Log each wait with account, action, and X to identify patterns.
  • Adjust pacing based on logged patterns to avoid future waits.

Evidence

Telegram’s API error reference files it under error code 420 FLOOD: “The maximum allowed number of attempts to invoke the given method with the given input parameters has been exceeded.”

Source

In Telethon, a Python MTProto library, it arrives as FloodWaitError with the wait in .seconds. By default the library sleeps through flood waits shorter than 60 seconds on its own, so your code only sees the longer ones.

Source

Bots on the HTTP Bot API. The same idea comes back as a 429 Too Many Requests error. Its retry_after field is, in Telegram’s words, “the number of seconds left to wait before the request can be repeated.”

Source

  • Record date: 2026-10-25T15:26:15.550Z