From 582e29dece1ae1a682e4311f8219db47f77de055 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 27 Aug 2020 10:59:28 +0200 Subject: [PATCH] Allow passing sleep_threshold=0 to always raise flood waits --- pyrogram/session/session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrogram/session/session.py b/pyrogram/session/session.py index bca1dc8f..3aecaab3 100644 --- a/pyrogram/session/session.py +++ b/pyrogram/session/session.py @@ -442,7 +442,7 @@ class Session: except FloodWait as e: amount = e.x - if amount > sleep_threshold > 0: + if amount > sleep_threshold >= 0: raise log.warning(f'[{self.client.session_name}] Sleeping for {amount}s (required by "{query}")')