mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 01:16:35 +03:00
Correctly handle flood_sleep_threshold=None and large values
The docstring said large values would be converted to 1 day, but they were not. With this change None and large values are handled correctly. Prevents https://github.com/tulir/mautrix-telegram/issues/380.
This commit is contained in:
parent
6817e19923
commit
3a56c8b0f4
|
@ -382,6 +382,15 @@ class TelegramBaseClient(abc.ABC):
|
|||
"""
|
||||
return self._sender.disconnected
|
||||
|
||||
@property
|
||||
def flood_sleep_threshold(self):
|
||||
return self._flood_sleep_threshold
|
||||
|
||||
@flood_sleep_threshold.setter
|
||||
def flood_sleep_threshold(self, value):
|
||||
# None -> 0, negative values don't really matter
|
||||
self._flood_sleep_threshold = min(value or 0, 24 * 60 * 60)
|
||||
|
||||
# endregion
|
||||
|
||||
# region Connecting
|
||||
|
|
Loading…
Reference in New Issue
Block a user