-
-
Notifications
You must be signed in to change notification settings - Fork 808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically Resolve Update Types in start_polling
method.
#1182
Conversation
✔️ Changelog found.Thank you for adding a description of the changes |
aiogram/dispatcher/dispatcher.py
Outdated
@@ -450,7 +451,7 @@ async def start_polling( | |||
polling_timeout: int = 10, | |||
handle_as_tasks: bool = True, | |||
backoff_config: BackoffConfig = DEFAULT_BACKOFF_CONFIG, | |||
allowed_updates: Optional[List[str]] = None, | |||
allowed_updates: Optional[List[str]] = UNSET_TYPE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the type hint correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like it replaced UNSET
, which is not available in the current version.
auto_resolve_update_types
argument to start_polling
method.start_polling
method.
Merged outside of this pull-request with small changes in due to incorrect type-hints is used. |
Description
Currently, the method
dp.resolve_used_update_types
can be improved for better readability and understandability, a better name for this function could be "get_registered_event_names", or "get_registered_update_types".So I changed the logic, that the dispatcher would automatically collect the update types used in handlers, if
allowed_updates
parameter is not specified.Type of change
Please delete options that are not relevant.
Checklist: