diff --git a/aiogram/client/bot.py b/aiogram/client/bot.py index 531db195..fb36062c 100644 --- a/aiogram/client/bot.py +++ b/aiogram/client/bot.py @@ -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 diff --git a/aiogram/client/default.py b/aiogram/client/default.py index 78dd0aa3..e3e70cfb 100644 --- a/aiogram/client/default.py +++ b/aiogram/client/default.py @@ -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(