pyrofork/pyrogram
fr0stb1rd 5112e5da36
Fix: Respect sleep_threshold=0 in invoke() to prevent unwanted FloodWait sleep
This PR updates the `invoke()` method to correctly handle `sleep_threshold=0`.

### Before:
Even when `sleep_threshold=0`, the client still waits for the full FloodWait duration.

### After:
With this change:
- If `sleep_threshold == 0`, it raises the FloodWait immediately (no sleep).
- If `sleep_threshold < 0`, it always raises (never sleeps).
- If `sleep_threshold > 0`, it only sleeps if `amount <= sleep_threshold`.

This makes `sleep_threshold` behave more as expected and allows advanced bot handling logic outside of Pyrogram.

Thanks!
2025-07-11 16:01:24 +03:00
..
connection Revert "fix: handle connection closure and retry logic in session management" 2025-05-18 19:57:20 +07:00
crypto pyrofork: Cleanup codes 2025-03-29 00:25:16 +07:00
enums pyrofork: Add todolist implementation 2025-07-10 19:56:51 +07:00
errors pyrofork: moar cleanups 2025-04-03 22:31:37 +07:00
handlers pyrofork: Cleanup codes 2025-03-29 00:25:16 +07:00
helpers pyrofork: Cleanup codes 2025-03-29 00:25:16 +07:00
methods pyrofork: Refactor folders 2025-07-10 19:56:52 +07:00
nav pyrofork: Cleanup codes 2025-03-29 00:25:16 +07:00
parser pyrofork: Cleanup codes 2025-03-29 00:25:16 +07:00
raw pyrofork: Cleanup codes 2025-03-29 00:25:16 +07:00
session Fix: Respect sleep_threshold=0 in invoke() to prevent unwanted FloodWait sleep 2025-07-11 16:01:24 +03:00
storage pyrofork: Cleanup codes 2025-03-29 00:25:16 +07:00
types pyrofork: types: Chat: _parse_dialog: Handle InputPeerUser and InputPeerChat 2025-07-10 19:56:53 +07:00
__init__.py pyrofork: Bump version to 2.3.68 2025-07-10 19:58:10 +07:00
client.py pyrofork: client: fix looping prompt when use qrcode as input 2025-07-10 19:56:52 +07:00
dispatcher.py Fix: Register RawUpdateHandler and Refactor Dispatcher for Better Modularity. 2025-06-06 19:08:42 +07:00
emoji.py Pyrofork: Update Copyright headers 2024-02-07 20:25:08 +07:00
file_id.py Pyrofork: Update Copyright headers 2024-02-07 20:25:08 +07:00
filters.py pyrofork: Adapt filters.linked_channel to latest changes 2025-07-10 19:56:52 +07:00
mime_types.py Pyrofork: Update Copyright headers 2024-02-07 20:25:08 +07:00
py.typed Add py.typed file for enhanced type hinting (#838) 2022-01-29 13:39:25 +01:00
sync.py Pyrofork: Update Copyright headers 2024-02-07 20:25:08 +07:00
utils.py pyrofork: Add reply_to_monoforum_id parameter to supported send_* 2025-06-10 22:38:08 +07:00