v1.11.0a1
·
232 commits
to master
since this release
1.11.0a1 - 2023-04-02
Added
- A static timeout implementation.
- Support for custom ID prefix matching to the Message component executors.
- Message components have support for loading components from class attributes again.
Support for this has been implemented throughyuyo.components.ActionColumnExecutorthis time. yuyo.components.SingleExecutorandyuyo.components.as_single_executorto allow registering a component executor with a single callback.- New component handling system to the component client which allows component executors to be used statelessly. This moves to using the classes in
yuyo.timeoutsto handle timeouts (rather than the component executors) and makes binding to a specific message optional.
This consists ofComponentClient.register_executorandComponentClient.deregister_executor. yuyo.components.with_static_text_menudecorator for declaring a static text select menu on aActionColumnExecutorsubclass.optionsparameter toActionColumnExecutor.add_static_text_select,ActionColumnExecutor.add_text_select, andActionRowExecutor.add_text_selectfor passing option builders.ComponentContext.id_matchandModalContext.id_metadataconvenient properties for getting the matching and metadata parts of the component's custom ID.Modal.id_match,Modal.id_metadataandModalContext.component_idsconvenience properties for getting the matching and metadata parts of the Modal's top-level custom ID and the sub-component custom IDs.ComponentExecutor.set_callbackandComponentExecutor.with_callbacknow both raiseValueErrorif":"is present incustom_id.id_metadataoption toActionColumnExecutor.__init__andModal.__init__to allow for setting the ID metadata of components per-init.
Changed
- Bumped the minimum Hikari version to
2.0.0.dev118.
Some of the breaking component changes listed in Hikari's change log around the component builders effect Yuyo's component executors. - Prefix matching behaviour is now always enabled for both modals and components.
- Message components now split by
":"for prefix matching like the modals client. - Marked most deprecated timeout class aliases using
typing.deprecated.
(onlyyuyo.modals.AbstractTimeoutwas skipped). yuyo.components.WaitForExecutornow inherits fromyuyo.components.WaitForExecutorand should also be passed totimeout=.ActionColumnExecutor.rowsnow returnshikari.api.MessageActionRowBuilder.- Message components will now give a "timed-out" ephemeral initial response when
ExecutorClosedis raised without any response. - The
authorsfield is now optional (defaulting to public) forWaitForExecutor.__init__,ComponentPaginator.__init__, andReactionPaginator.__init__. - Renamed
yuyo.timeouts.BasicTimeouttoyuyo.timeouts.SlidingTimeout. - Renamed
ModalClient.set_modaltoModal.register_modal. - Renamed
ModalClient.remove_modaltoModal.deregister_modal. - Renamed
ComponentClient.get_executortoComponentClient.get_executor_for_message. - Renamed
ComponentClient.remove_executortoComponentClient.deregister_message. - Renamed
add_andwith_component methods to better match Hikari's new naming scheme:ActionRowExecutor.add_buttonto.add_interative_buttonActionRowExecutor.add_channel_selectto.add_channel_menuActionRowExecutor.add_text_selectto.add_text_menuActionColumnExecutor.add_buttonto.add_interative_buttonActionColumnExecutor.add_channel_selectto.add_channel_menuActionColumnExecutor.add_text_selectto.add_text_menuActionColumnExecutor.add_static_buttonto.add_static_interactive_buttonActionColumnExecutor.with_static_buttonto.with_static_interactive_buttonActionColumnExecutor.add_static_channel_selectto.add_static_channel_menuActionColumnExecutor.with_static_channel_selectto.with_static_channel_menuActionColumnExecutor.add_static_text_selectto.add_static_text_menuyuyo.components.with_static_buttonto.with_static_interactive_buttonyuyo.components.with_static_channel_selectto.with_static_channel_menu
Deprecated
- The constant ID component handling system.
This has been replaced with passingyuyo.components.SingleExecutortoComponentClient.register_executor. - Passing
timeouttoComponentExecutor.__init__,ActionRowExecutor.__init__,ActionColumnExecutor.__init__, andComponentPaginator.__init__.
This has been replaced by passingtimeouttoComponentClient.register_executorto allow for the stateless reuse of component executors. AbstractComponentExecutor.has_expired.ActionRowExecutor.is_full.ComponentClient.set_executor, this has been replaced byComponent.register_executor.- Passing
yuyo.components.ActionRowExecutortoActionColumnExecutor.add_row. This now takeshikari.api.MessageActionRowBuilder. - The
prefix_matchparameter as this is now always enabled.
Removed
yuyo.modals.NoDefault.