mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
settings for max_sends_per_secods
This commit is contained in:
parent
705917c853
commit
132fc5fd22
2 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue