Skip to content

miniproto.invoke.should_sleep_for_flood_wait

miniproto.invoke.should_sleep_for_flood_wait

Section titled “miniproto.invoke.should_sleep_for_flood_wait”
should_sleep_for_flood_wait(error: FloodWait, threshold: int | None) -> bool

Return whether a flood wait is short enough for automatic sleeping.

A None threshold disables automatic waiting; otherwise the wait must not exceed the configured threshold in seconds.

Parameters:

  • error (FloodWait) – Classified Telegram flood-wait response.
  • threshold (int | None) – Maximum automatically slept duration in seconds, or None to disable it.