Skip to content

v1.11.0a1

Choose a tag to compare

@FasterSpeeding FasterSpeeding released this 02 Apr 20:34
· 232 commits to master since this release
834c30d

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 through yuyo.components.ActionColumnExecutor this time.
  • yuyo.components.SingleExecutor and yuyo.components.as_single_executor to 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.timeouts to handle timeouts (rather than the component executors) and makes binding to a specific message optional.
    This consists of ComponentClient.register_executor and ComponentClient.deregister_executor.
  • yuyo.components.with_static_text_menu decorator for declaring a static text select menu on a ActionColumnExecutor subclass.
  • options parameter to ActionColumnExecutor.add_static_text_select, ActionColumnExecutor.add_text_select, and ActionRowExecutor.add_text_select for passing option builders.
  • ComponentContext.id_match and ModalContext.id_metadata convenient properties for getting the matching and metadata parts of the component's custom ID.
  • Modal.id_match, Modal.id_metadata and ModalContext.component_ids convenience properties for getting the matching and metadata parts of the Modal's top-level custom ID and the sub-component custom IDs.
  • ComponentExecutor.set_callback and ComponentExecutor.with_callback now both raise ValueError if ":" is present in custom_id.
  • id_metadata option to ActionColumnExecutor.__init__ and Modal.__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.
    (only yuyo.modals.AbstractTimeout was skipped).
  • yuyo.components.WaitForExecutor now inherits from yuyo.components.WaitForExecutor and should also be passed to timeout=.
  • ActionColumnExecutor.rows now returns hikari.api.MessageActionRowBuilder.
  • Message components will now give a "timed-out" ephemeral initial response when ExecutorClosed is raised without any response.
  • The authors field is now optional (defaulting to public) for WaitForExecutor.__init__, ComponentPaginator.__init__, and ReactionPaginator.__init__.
  • Renamed yuyo.timeouts.BasicTimeout to yuyo.timeouts.SlidingTimeout.
  • Renamed ModalClient.set_modal to Modal.register_modal.
  • Renamed ModalClient.remove_modal to Modal.deregister_modal.
  • Renamed ComponentClient.get_executor to ComponentClient.get_executor_for_message.
  • Renamed ComponentClient.remove_executor to ComponentClient.deregister_message.
  • Renamed add_ and with_ component methods to better match Hikari's new naming scheme:
    • ActionRowExecutor.add_button to .add_interative_button
    • ActionRowExecutor.add_channel_select to .add_channel_menu
    • ActionRowExecutor.add_text_select to .add_text_menu
    • ActionColumnExecutor.add_button to .add_interative_button
    • ActionColumnExecutor.add_channel_select to .add_channel_menu
    • ActionColumnExecutor.add_text_select to .add_text_menu
    • ActionColumnExecutor.add_static_button to .add_static_interactive_button
    • ActionColumnExecutor.with_static_button to .with_static_interactive_button
    • ActionColumnExecutor.add_static_channel_select to .add_static_channel_menu
    • ActionColumnExecutor.with_static_channel_select to .with_static_channel_menu
    • ActionColumnExecutor.add_static_text_select to .add_static_text_menu
    • yuyo.components.with_static_button to .with_static_interactive_button
    • yuyo.components.with_static_channel_select to .with_static_channel_menu

Deprecated

  • The constant ID component handling system.
    This has been replaced with passing yuyo.components.SingleExecutor to ComponentClient.register_executor.
  • Passing timeout to ComponentExecutor.__init__, ActionRowExecutor.__init__, ActionColumnExecutor.__init__, and ComponentPaginator.__init__.
    This has been replaced by passing timeout to ComponentClient.register_executor to allow for the stateless reuse of component executors.
  • AbstractComponentExecutor.has_expired.
  • ActionRowExecutor.is_full.
  • ComponentClient.set_executor, this has been replaced by Component.register_executor.
  • Passing yuyo.components.ActionRowExecutor to ActionColumnExecutor.add_row. This now takes hikari.api.MessageActionRowBuilder.
  • The prefix_match parameter as this is now always enabled.

Removed

  • yuyo.modals.NoDefault.