MadelineProtoDocs/docs/docs/FLOOD_WAIT.md

18 lines
777 B
Markdown
Raw Normal View History

2018-04-11 14:17:45 +02:00
---
title: Avoiding FLOOD_WAITs
description: If you make too many requests to telegram, you might get FLOOD_WAITed for a while. To avoid these flood waits, you must calculate the flood wait rate.
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
2018-04-01 13:19:25 +02:00
# Avoiding FLOOD_WAITs
2018-04-11 14:17:45 +02:00
If you make too many requests to telegram, you might get FLOOD_WAITed for a while. To avoid these flood waits, you must calculate the flood wait rate.
2018-04-01 13:19:25 +02:00
Calculate it by making N of method calls until you get a FLOOD_WAIT_X
```
floodwaitrate = time it took you to make the method calls + X
```
Use sleep to execute max N calls in `floodwaitrate` seconds, this way you won't get flood waited!
2018-04-01 13:55:07 +02:00
<a href="https://docs.madelineproto.xyz/docs/LOGGING.html">Next section</a>