settings for max_sends_per_secods

This commit is contained in:
uran-content 2025-07-28 15:22:06 +03:00
parent 705917c853
commit 132fc5fd22
2 changed files with 3 additions and 2 deletions

View file

@ -292,10 +292,10 @@ class Bot:
if session is None:
session = AiohttpSession()
if default is None:
default = DefaultBotProperties()
default = DefaultBotProperties(max_sends_per_secods=29)
self.session = session
self.limiter = PrioritySlidingWindowLimiter(max_calls=29, period=1.0)
self.limiter = PrioritySlidingWindowLimiter(max_calls=default.max_sends_per_secods, period=1.0)
# Few arguments are completely removed in 3.7.0 version
# Temporary solution to raise an error if user passed these arguments

View file

@ -55,6 +55,7 @@ class DefaultBotProperties:
"""Show link preview above text."""
show_caption_above_media: Optional[bool] = None
"""Show caption above media."""
max_sends_per_secods: Optional[int] = None
def __post_init__(self) -> None:
has_any_link_preview_option = any(