All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Bumped the minimum Alluka version to v0.4.0
- Moved away from using
typing.runtime_checkableas this is unreliable in newer Python versions. - List status' successfully post logging call.
- Support for Python 3.9 and 3.10.
1.23.1 - 2024-10-07
- Support Python 3.13
1.23.0 - 2024-07-14
- [BaseContext.alluka][yuyo.interactions.BaseContext.alluka] property for getting the context's alluka client.
- [pagination.ResponseKwargs][yuyo.pagination.ResponseKwargs] is now publicly exported to allow 3rd party implementations of [AbstractPage.ctx_to_kwargs][yuyo.pagination.AbstractPage.ctx_to_kwargs] and [AbstractPage.to_kwargs][yuyo.pagination.AbstractPage.to_kwargs] to have properly typed return types.
- [pagination.ResponseKwargs][yuyo.pagination.ResponseKwargs]'s fields are now all marked as not required.
1.22.0 - 2024-07-11
- Support for component pagination based on global ("static") bot data. More information on this can be found here.
yuyo.components.BaseContextas this has been moved to [yuyo.interactions.BaseContext][].
1.21.1 - 2024-04-29
- Bumped the minimum Alluka version to
v0.2.0. - The component, modal and reaction clients will now use the "local" Alluka client returned by [alluka.local.get][] if no client is passed and a local Alluka client is set.
1.21.0 - 2024-04-21
- Component [StreamExecutor][yuyo.components.StreamExecutor] for streaming over received component contexts.
- Support for specifying specific component IDs for [WaitForExecutor][yuyo.components.WaitForExecutor].
1.20.0 - 2024-03-29
yuyo commands declarecommand for declaring app commands based on a schema file.yuyo commands fetchcommand for fetching the command schema file for an existing bot.yuyo commands renamecommand for renaming the declared app commands.
1.19.1 - 2023-12-28
- Support for Python 3.12.
1.19.0 - 2023-08-30
- [ComponentClient.get_executor][yuyo.components.ComponentClient.get_executor] method for getting the executor registered globally for a specific custom ID.
- The ephemeral default is now ignored for message update create initial response and defer calls. (This likely won't effect real world behaviour).
- Explicitly passing
ephemeral=Falseto [create_initial_response][yuyo.interactions.BaseContext.create_initial_response] or [create_followup][yuyo.interactions.BaseContext.create_followup] will now correctly override the client-level ephemeral default. - The component paginator will no-longer error out with a "Initial response has already been created" error when the jump to last page button tries to push the internal generator forwards only to find out it's depleted.
1.18.0 - 2023-08-23
- [yuyo.components.builder][] (a class descriptor), [ActionColumnExecutor.add_builder][yuyo.components.ActionColumnExecutor.add_builder], and [ActionColumnExecutor.add_static_builder][yuyo.components.ActionColumnExecutor.add_static_builder] functions and methods for adding raw component builders to a column without an associated callback.
- [yuyo.pagination.Page][] is now exported top-level at
Yuyo.Page.
- Properly track method names for callbacks registered using
[as_interactive_button][yuyo.components.as_interactive_button].
This allows the custom ID metadata to be overridden by passing
id_metadata={"function_name": "METADATA"}to [ActionColumnExecutor.__init__][yuyo.components.ActionColumnExecutor.init].
1.17.0 - 2023-08-18
- Wait for implementation for modals.
- [Page.__init__][yuyo.pagination.Page.init]'s signature now more closely
Hikari's message create methods: with new
attachmentandembedkeyword arguments for passing singular values while also now allowing an embed or file to be passed ascontent.
- Timed out individual requests will no-longer lead to the chunk tracker crashing.
1.16.0 - 2023-08-11
- [yuyo.InteractionError][yuyo.interactions.InteractionError] error type which can be used to end modal and component interactions with a message.
- [ComponentClient.from_tanjun][yuyo.components.ComponentClient.from_tanjun] and [ModalClient.from_tanjun][yuyo.modals.ModalClient.from_tanjun] both now correctly pass through the relevant hikari bot components.
1.15.0 - 2023-08-10
- Support customising the
response_typewhen deferring and creating the initial response to a modal call. .cache,.events,.rest,.server,.shardsand.voiceattributes to [yuyo.ComponentClient][yuyo.components.ComponentClient], [yuyo.ComponentContext][yuyo.components.ComponentContext], [yuyo.ModalClient][yuyo.modals.ModalClient], and [yuyo.ModalContext][yuyo.modals.ModalContext] which represent parts of the linked Hikari bot in a similar style to tanjun.- The following utility attributes to [yuyo.ComponentContext][yuyo.components.ComponentContext]
and [yuyo.ModalContext][yuyo.modals.ModalContext] which mostly relay attributes from the inner
interaction:
.author,.channel_id,.created_at,.guild_id,.member,.shard.
1.14.2 - 2023-05-08
- The fields for a [ModalOptions][yuyo.modals.ModalOptions] are now correctly
tracked when added to a [Modal][yuyo.modals.Modal] instance and are
no-longer erroneously tracked as static fields for
type(modal).
1.14.1 - 2023-05-03
- [ComponentClient.register_executor][yuyo.components.ComponentClient.register_executor]
now raises a
ValueErrorif any of the custom IDs or the message ID is already registered to better matchregister_modal. - [ComponentClient.deregister_executor][yuyo.components.ComponentClient.deregister_executor]
now raises a
KeyErrorif the component isn't registered to better match the other deregister methods.
- Erroneous
prefix_matchparameter from [yuyo.modals.with_text_input][] which should've been removed inv1.14.0
1.14.0 - 2023-05-03
authorsoption to [components.ActionColumnExecutor.__init__][yuyo.components.ActionColumnExecutor.init].- Functions for generating Discord Oauth2 authorize links and bot invite links to [yuyo.links][].
- [ActionColumnExecutor.with_interactive_button][yuyo.components.ActionColumnExecutor.with_interactive_button].
- [ActionColumnExecutor.with_static_interactive_button][yuyo.components.ActionColumnExecutor.with_static_interactive_button].
- [ActionColumnExecutor.with_mentionable_menu][yuyo.components.ActionColumnExecutor.with_mentionable_menu].
- [ActionColumnExecutor.with_static_mentionable_menu][yuyo.components.ActionColumnExecutor.with_static_mentionable_menu].
- [ActionColumnExecutor.with_role_menu][yuyo.components.ActionColumnExecutor.with_role_menu].
- [ActionColumnExecutor.with_static_role_menu][yuyo.components.ActionColumnExecutor.with_static_role_menu].
- [ActionColumnExecutor.with_user_menu][yuyo.components.ActionColumnExecutor.with_user_menu].
- [ActionColumnExecutor.with_static_user_menu][yuyo.components.ActionColumnExecutor.with_static_user_menu].
- [ActionColumnExecutor.with_channel_menu][yuyo.components.ActionColumnExecutor.with_channel_menu].
- [ActionColumnExecutor.with_text_menu][yuyo.components.ActionColumnExecutor.with_text_menu].
- [ActionColumnExecutor.with_static_text_menu][yuyo.components.ActionColumnExecutor.with_static_text_menu].
- [yuyo.components.column_template][] shorthand function for creating a column subclass.
- Message component custom IDs are now defaulted to a constant ID that's generated
from the function's path (which includes the relevant module and class
qualnames) when added using the
as_descriptors in [yuyo.components][]. - The
id_metadatafield in [components.ActionColumnExecutor.__init__][yuyo.components.ActionColumnExecutor.init] now also supports using a component callback's name in the class' namespace as the key (specifically when it was added using one of theas_descriptors). - The auto-generated default UUID custom IDs now only consist of the UUID's hex
(without any
-), bringing the length down from 36 chars to 32. - The descriptors returned by the
as_decorators in [yuyo.components][] are now hidden when accessed directly on classes. The decorated callback will now be directly exposed as the class attribute instead.
- [ActionColumnExecutor][yuyo.components.ActionColumnExecutor] and
[Modal][yuyo.modals.Modal] both now properly relay
__init_subclass__keyword arguments when being used in mixed inheritance.
yuyo.components.with_static_interactive_buttonyuyo.components.with_static_link_buttonyuyo.components.with_static_select_menuyuyo.components.with_static_channel_menuyuyo.components.with_static_text_menu- The following deprecated functionality and aliases:
ActionRowExecutorin favour of the new action column executor.- Allowing callback to be passed as the first argument and type as the second argument for [ActionColumnExecutor.add_select_menu][yuyo.components.ActionColumnExecutor.add_select_menu], and [ActionColumnExecutor.add_static_select_menu][yuyo.components.ActionColumnExecutor.add_static_select_menu].
timeoutkeyword argument from [ComponentExecutor.__init__][yuyo.components.ComponentExecutor.init], [ActionColumnExecutor.__init__][yuyo.components.ActionColumnExecutor.init], and [ComponentPaginator.__init__][yuyo.components.ComponentPaginator.init].prefix_matchkeyword argument from [Modal.add_static_text_input][yuyo.modals.Modal.add_static_text_input], [Modal.add_text_input][yuyo.modals.Modal.add_text_input], [modals.with_static_text_input][yuyo.modals.with_static_text_input], [modals.with_text_input][yuyo.modals.with_text_input], and [modals.text_input][yuyo.modals.text_input].ComponentContext.select_channelsComponentContext.select_rolesComponentContext.select_textsComponentContext.select_usersComponentContext.select_membersComponentClient.set_constant_idComponentClient.get_constant_idComponentClient.remove_constant_idComponentClient.with_constant_idComponentClient.set_executorComponentClient.get_executorComponentClient.remove_executorAbstractComponentExecutor.has_expiredAbstractComponentExecutor.timeoutComponentExecutor.has_expiredComponentExecutor.timeoutActionColumnExecutor.timeoutActionColumnExecutor.has_expiredActionColumnExecutor.add_buttonActionColumnExecutor.add_interative_buttonActionColumnExecutor.add_static_buttonActionColumnExecutor.add_static_interative_buttonActionColumnExecutor.with_static_buttonActionColumnExecutor.with_static_interative_buttonActionColumnExecutor.with_static_select_menuActionColumnExecutor.add_channel_selectActionColumnExecutor.add_static_channel_selectActionColumnExecutor.with_static_channel_selectActionColumnExecutor.add_text_selectActionColumnExecutor.add_static_text_selectComponentPaginator.builderComponentPaginator.add_rowcomponents.with_static_buttoncomponents.with_static_interative_buttoncomponents.with_static_channel_selectInviteLink.fetchInviteLink.getMessageLink.fetchMessageLink.getTemplateLink.fetchWebhookLink.fetchmodals.AbstractTimeoutmodals.BasicTimeoutmodals.NeverTimeoutModalClient.set_modalModalClient.remove_modaltimeouts.BasicTimeoutyuyo.BasicTimeout
1.13.0a1 - 2023-04-25
- [components.Paginator][yuyo.components.Paginator] alias of [components.ComponentPaginator][yuyo.components.ComponentPaginator].
- [reactions.Handler][yuyo.reactions.Handler] alias of [reactions.ReactionHandler][yuyo.reactions.ReactionHandler].
- [reactions.Paginator][yuyo.reactions.Paginator] alias of [reactions.ReactionPaginator][yuyo.reactions.ReactionPaginator].
- [ComponentPaginator][yuyo.components.ComponentPaginator] now implements
[ActionColumnExecutor][yuyo.components.ActionColumnExecutor] rather than
ActionRowExecutor. The main (breaking) consequence of this change is that you now need to passpagintor.rowstocomponentsrather than passing the paginator itself tocomponent. - Moved out the paginator logic used by [yuyo.components.ComponentPaginator][] and [yuyo.reactions.ReactionPaginator][] to the new [yuyo.pagination.Paginator][] class.
yuyo.components.ActionRowExecutorin favour of the action column executor.ActionColumnExecutor.add_row.
- [reactions.Client][yuyo.reactions.Client] now correctly points towards [reactions.ReactionClient][yuyo.reactions.ReactionClient].
- Some edge cases where the paginators were sending the current page in response to a reaction/interaction instead of giving a noop response or just not responding.
timeoutargument from [ComponentPaginator.__init__][yuyo.components.ComponentPaginator.init]."WaitFor"fromyuyo.components.__all__.
1.12.0a1 - 2023-04-24
ephemeral_defaultoption to [ActionColumnExecutor.__init__][yuyo.components.ActionColumnExecutor.init].- Shorthand methods and functions for adding/declaring mentionable, role and user menus:
- [components.as_mentionable_menu][yuyo.components.as_mentionable_menu]
- [components.as_role_menu][yuyo.components.as_role_menu]
- [components.as_user_menu][yuyo.components.as_user_menu]
- [ActionColumnExecutor.add_mentionable_menu][yuyo.components.ActionColumnExecutor.add_mentionable_menu]
- [ActionColumnExecutor.add_static_mentionable_menu][yuyo.components.ActionColumnExecutor.add_static_mentionable_menu]
- [ActionColumnExecutor.add_role_menu][yuyo.components.ActionColumnExecutor.add_role_menu]
- [ActionColumnExecutor.add_static_role_menu][yuyo.components.ActionColumnExecutor.add_static_role_menu]
- [ActionColumnExecutor.add_user_menu][yuyo.components.ActionColumnExecutor.add_user_menu]
- [ActionColumnExecutor.add_static_user_menu][yuyo.components.ActionColumnExecutor.add_static_user_menu]
ActionRowExecutor.add_mentionable_menuActionRowExecutor.add_role_menuActionRowExecutor.add_user_menu
- [ActionColumnExecutor][yuyo.components.ActionColumnExecutor] now allows overriding inherited component class descriptors.
- The
add_staticmethods on [ActionColumnExecutor][yuyo.components.ActionColumnExecutor] now override any previously added sub-component with the same match ID rather than append a duplicate entry.
- [ActionColumnExecutor][yuyo.components.ActionColumnExecutor] now respects the order component descriptors were defined in on the class.
1.11.2a1 - 2023-04-10
- Support for parsing message links to [yuyo.links][].
- Added support for
ptb.andcanary.links to [yuyo.links][]. - Modals now default the per-field custom IDs (i.e. for text components) to the parameter's name (attribute name for [ModalOptions][yuyo.modals.ModalOptions] fields), if set.
- Renamed the link get and fetch methods:
InviteLink.fetchto [InviteLink.fetch_invite][yuyo.links.InviteLink.fetch_invite]InviteLink.getto [InviteLink.get_invite][yuyo.links.InviteLink.get_invite]MessageLink.fetchto [MessageLink.fetch_message][yuyo.links.MessageLink.fetch_message]MessageLink.getto [MessageLink.get_message][yuyo.links.MessageLink.get_message]TemplateLink.fetchto [TemplateLink.fetch_template][yuyo.links.TemplateLink.fetch_template]WebhookLink.fetchto [WebhookLink.fetch_webhook][yuyo.links.WebhookLink.fetch_webhook]
- [ModalOptions][yuyo.modals.ModalOptions] attributes now correctly expose the values passed to the modal rather than internal descriptors.
- [ChunkTracker.set_auto_chunk_members][yuyo.chunk_tracker.ChunkTracker.set_auto_chunk_members]
now correctly disables auto chunking when [False][] is passed after it has been previously
enabled. This now also always changes the configuration for
chunk_presences. - Some typoed function names which were missing the "c" in "interactive".
- [AsgiBot.start][yuyo.asgi.AsgiBot.start] and [AsgiBot.close][yuyo.asgi.AsgiBot.close]
will now call the startup and shutdown callbacks respectively when
asgi_managed=False.
1.11.1a1 - 2023-04-05
callbackandtypehave been flipped (makingtypethe first argument andcallbackthe second one) for the following functions:ActionRowExecutor.add_select_menu- [ActionColumnExecutor.add_select_menu][yuyo.components.ActionColumnExecutor.add_select_menu]
- [ActionColumnExecutor.add_static_select_menu][yuyo.components.ActionColumnExecutor.add_static_select_menu]
with_static_select_menu
- Renamed the component context select menu data properties:
ComponentContext.select_channelsto [ComponentContext.selected_channels][yuyo.components.ComponentContext.selected_channels]ComponentContext.select_rolesto [ComponentContext.selected_roles][yuyo.components.ComponentContext.selected_roles]ComponentContext.select_textsto [ComponentContext.selected_texts][yuyo.components.ComponentContext.selected_texts]ComponentContext.select_usersto [ComponentContext.selected_users][yuyo.components.ComponentContext.selected_users]ComponentContext.select_membersto [ComponentContext.selected_members][yuyo.components.ComponentContext.selected_members]
- Passing
callbackas the first argument when adding a select menu to a component executor or column. - The
with_{}methods on [yuyo.components.ActionColumnExecutor][].
- [yuyo.modals.modal][] and [yuyo.modals.as_modal][] both now properly support DI for the modal's callback.
- [yuyo.modals.as_modal][] and [yuyo.modals.as_modal_template][] both now allow passing
parse_signaturetyping wise. - [ComponentClient.register_executor][yuyo.components.ComponentClient.register_executor] now defaults to unlimited uses instead of 1 use.
1.11.0a1 - 2023-04-02
- 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][yuyo.components.ComponentClient.register_executor] and [ComponentClient.deregister_executor][yuyo.components.ComponentClient.deregister_executor].
yuyo.components.with_static_text_menudecorator for declaring a static text select menu on a [ActionColumnExecutor][yuyo.components.ActionColumnExecutor] subclass.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_metadataand [ModalContext.component_ids][yuyo.modals.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][yuyo.components.ComponentExecutor.set_callback] and
[ComponentExecutor.with_callback][yuyo.components.ComponentExecutor.with_callback] now
both raise [ValueError][] if
":"is present incustom_id. id_metadataoption to [ActionColumnExecutor.__init__][yuyo.components.ActionColumnExecutor.init] and [Modal.__init__][yuyo.modals.Modal.init] to allow for setting the ID metadata of components per-init.
- 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.WaitForExecutor][] now inherits from [yuyo.components.WaitForExecutor][]
and should also be passed to
timeout=. - [ActionColumnExecutor.rows][yuyo.components.ActionColumnExecutor.rows] now returns [hikari.api.MessageActionRowBuilder][hikari.api.special_endpoints.MessageActionRowBuilder].
- Message components will now give a "timed-out" ephemeral initial response when [ExecutorClosed][yuyo.components.ExecutorClosed] is raised without any response.
- The
authorsfield is now optional (defaulting to public) for [WaitForExecutor.__init__][yuyo.components.WaitForExecutor.init], [ComponentPaginator.__init__][yuyo.components.ComponentPaginator.init], and [ReactionPaginator.__init__][yuyo.reactions.ReactionPaginator.init]. - Renamed
yuyo.timeouts.BasicTimeoutto [yuyo.timeouts.SlidingTimeout][]. - Renamed
ModalClient.set_modalto [Modal.register_modal][yuyo.modals.ModalClient.register_modal]. - Renamed
ModalClient.remove_modalto [Modal.deregister_modal][yuyo.modals.ModalClient.deregister_modal]. - Renamed
ComponentClient.get_executorto [ComponentClient.get_executor_for_message][yuyo.components.ComponentClient.get_executor_for_message]. - Renamed
ComponentClient.remove_executorto [ComponentClient.deregister_message][yuyo.components.ComponentClient.deregister_message]. - Renamed
add_andwith_component methods to better match Hikari's new naming scheme:ActionRowExecutor.add_buttonto.add_interactive_buttonActionRowExecutor.add_channel_selectto.add_channel_menuActionRowExecutor.add_text_selectto.add_text_menuActionColumnExecutor.add_buttonto.add_interactive_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
- The constant ID component handling system. This has been replaced with passing [yuyo.components.SingleExecutor][] to [ComponentClient.register_executor][yuyo.components.ComponentClient.register_executor].
- Passing
timeoutto [ComponentExecutor.__init__][yuyo.components.ComponentExecutor.init],ActionRowExecutor.__init__, [ActionColumnExecutor.__init__][yuyo.components.ActionColumnExecutor.init], and [ComponentPaginator.__init__][yuyo.components.ComponentPaginator.init]. This has been replaced by passingtimeoutto [ComponentClient.register_executor][yuyo.components.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][yuyo.components.ComponentClient.register_executor].- Passing
yuyo.components.ActionRowExecutortoActionColumnExecutor.add_row. This now takes [hikari.api.MessageActionRowBuilder][hikari.api.special_endpoints.MessageActionRowBuilder]. - The
prefix_matchparameter as this is now always enabled.
yuyo.modals.NoDefault.
1.10.1a1 - 2023-03-25
- Some convenience properties to [ComponentContext][yuyo.components.ComponentContext] for getting select
menu values:
.select_channels.select_roles.select_texts.select_users.select_members
- The [yuyo.components.Context][] and [yuyo.modals.Context][] aliases.
- The [yuyo.components.Client][], [yuyo.modals.Client][], and [yuyo.reactions.Client][] aliases.
- A Modal text input's
defaultwill now also be used forvaluewhenvalueis left undefined anddefaultis a string of<=4000characters. - Increased the default timeout for modals to 2 minutes.
- Text select menus will no-longer lead to an error being returned by Discord when
max_valuesis greater then the count of its choices.
1.10.0a1 - 2023-03-20
- Support for declaring modal options in the modal callback's signature.
- Moved
yuyo.modals.AbstractTimeout,yuyo.modals.BasicTimeoutandyuyo.modals.NeverTimeoutto new [yuyo.timeouts][] module.
yuyo.modals.AbstractTimeout,yuyo.modals.BasicTimeoutandyuyo.modals.NeverTimeoutas deprecated aliases
- Modals now correctly default to a timeout duration of 10 seconds rather than 10 days.
- The deprecated
yuyo.components.MultiComponentExecutorandyuyo.components.ChildActionRowExecutortypes. ActionRowExecutor.add_buttoncan no-longer be used to add link buttons.- [yuyo.modals.Modal][] subclasses will no-longer inherits fields.
1.9.1a1 - 2023-03-07
- Re-exposed
yuyo.reactions.EventTas [yuyo.reactions.ReactionEventT][].
token_typenow defaults to"Bot"when a string token is passed for [AsgiBot.__init__][yuyo.asgi.AsgiBot.init].
- [yuyo.modals.modal][] and [yuyo.modals.as_modal][] no-longer lead to Alluka's type-hint introspection raising an exception.
- Handling of defaulting empty modal text inputs.
- Add
typeproperty toyuyo.components.ActionRowExecutorandyuyo.components.ChildActionRowExecutorto fix compatibility withHikari>=2.0.0.dev117.
1.9.0a1 - 2023-02-27
from_tanjunconvenience classmethods for initialising from a Tanjun client to [ComponentClient][yuyo.modals.ModalClient], [ModalClient][yuyo.modals.ModalClient], [ReactionClient][yuyo.reactions.ReactionClient], and [ServiceManager][yuyo.list_status.ServiceManager].allukakeyword-argument to tofrom_gateway_botandfrom_rest_botmethods on [ComponentClient][yuyo.modals.ModalClient], [ModalClient][yuyo.modals.ModalClient], and [ReactionClient][yuyo.reactions.ReactionClient].
timeoutis now keyword-only for [ChunkTracker.__init__][yuyo.chunk_tracker.ChunkTracker.init].- The Alluka bound clients ([ComponentClient][yuyo.modals.ModalClient], [ModalClient][yuyo.modals.ModalClient], and [ReactionClient][yuyo.reactions.ReactionClient]) now all register themselves as type dependencies when they're not passed a 3rd party client.
- Prefix matched custom IDs are now correctly lower priority for modals.
- [AsgiBot.remove_shutdown_callback][yuyo.asgi.AsgiBot.remove_shutdown_callback] and [AsgiBot.remove_startup_callback][yuyo.asgi.AsgiBot.remove_startup_callback] now raise a [ValueError][] if the callback isn't registered (as per the documented behaviour) instead of silently passing.
- Unnecessary entries from module
__all__s (i.e. type hints, abstract classes, base classes and internal signal error classes). - Type variables are no-longer publicly exposed other than a couple callback types.
1.8.0a1.post1 - 2023-02-23
- The [yuyo.components.ComponentPaginator][] will no-longer send a new message with "MESSAGE_UPDATE" as the content when the last entry button is pressed for the first time instead of marking it as loading.
- The [yuyo.components.ComponentPaginator][] will no-longer create a new message with "MESSAGE_UPDATE" as the content instead of giving a noop update response.
1.8.0a1 - 2023-02-23
timeoutconfig to [ChunkTracker.__init__][yuyo.chunk_tracker.ChunkTracker.init].bot_managedconfig to [ComponentClient.from_rest_bot][yuyo.components.ComponentClient.from_rest_bot].- [ComponentContext.create_modal_response][yuyo.components.ComponentContext.create_modal_response] method.
- Support for modals in
yuyo.modals. - [yuyo.components.ActionColumnExecutor][] which handles building and executing multiple message action row components and also introduces a class template system for message components in a similar fashion to modals.
- The
response_typeargument is now keyword only and defaults to [ResponseType.MESSAGE_CREATE][hikari.interactions.base_interactions.ResponseType.MESSAGE_CREATE] in [ComponentContext.create_initial_response][yuyo.components.ComponentContext.create_initial_response]. - The
defer_typeargument is now keyword only and defaults to [ResponseType.DEFERRED_MESSAGE_CREATE][hikari.interactions.base_interactions.ResponseType.DEFERRED_MESSAGE_CREATE] in [ComponentContext.defer][yuyo.components.ComponentContext.defer].
yuyo.components.MultiComponentExecutorandyuyo.components.ChildActionRowExecutor. [yuyo.components.ActionColumnExecutor][] should be used instead.- Using
ActionRowExecutor.add_buttonto add specifically link buttons.ActionRowExecutor.add_link_buttonshould be used instead.
- The
add_{}_buttonmethods on [ComponentPaginator][yuyo.components.ComponentPaginator] now ignoreemojiwhenlabelis passed to avoid erroring when users don't explicitly unset the default foremoji.
- The
AbstractReactionHandler.last_triggeredandReactionHandler.timeoutproperties as these were leaking impl detail.
1.7.0a1 - 2023-02-14
- Support for the new select menu types to
yuyo.to_builder. ActionRowExecutor.add_channel_selectfor adding channel select menus to an action row.ActionRowExecutor.add_select_menufor adding the other new select menu types to an action row.- [yuyo.pagination.Page][] type which can be used to represent a response page in the paginators. This allows configuring attachments and multiple embeds for a page.
- Methods for manually setting the buttons for [yuyo.components.ComponentPaginator][] and [yuyo.reactions.ReactionPaginator][] which allow manually overriding the config for each button or reaction.
from_gateway_botclassmethods can now also take cache-lessShardAwarebots.- Bumped minimum Hikari version to
2.0.0.dev116. - Renamed
ErrorManager.with_ruleto [ErrorManager.add_rule][yuyo.backoff.ErrorManager.add_rule] and made its arguments positional only. - The
guildargument for [yuyo.chunk_tracker.ChunkTracker.request_guild_members][] is now positional only. iteratoris now positional only in [ReactionPaginator.__init__][yuyo.reactions.ReactionPaginator.init] and [ComponentPaginator.__init__][yuyo.components.ComponentPaginator.init].linesis now positional only in [yuyo.pagination.async_paginate_string][], [yuyo.pagination.sync_paginate_string][] and [yuyo.pagination.paginate_string][].- Renamed
add_callbacktoset_callbackonComponentExecutorandReactionHandler. ActionRowExecutor.add_buttonnow takes all the button's options as arguments. This also now returns the action row and adds the button to the row immediately (without any calls toadd_to_parent).- Renamed the old
ActionRowExecutor.add_select_menutoActionRowExecutor.add_text_selectand added the other select menu's config as keyword-arguments. - Renamed
add_handlerto [ReactionClient.set_handler][yuyo.reactions.ReactionClient.set_handler]. - [ReactionClient.set_handler][yuyo.reactions.ReactionClient.set_handler]'s arguments are now all positional-only.
- [ComponentPaginator.get_next_entry][yuyo.components.ComponentPaginator.get_next_entry] and
[ReactionPaginator.get_next_entry][yuyo.reactions.ReactionPaginator.get_next_entry] now both
return [yuyo.pagination.Page][] rather than a tuple.
This can be used to create a response easily by passing the result of
[Page.to_kwargs][yuyo.pagination.Page.to_kwargs] to the create message or execute webhook REST method as
**kwargs.
Context.create_initial_response(and by extensionContext.respondfor the initial response specifically) will no-longer try to pass the attachment, component or embed as the actual message content when passed for thecontentargument for REST-based interaction commands.BLACK_CROSScan now be passed to [ComponentPaginator.__init__][yuyo.components.ComponentPaginator.init] and [ReactionPaginator.__init__][yuyo.reactions.ReactionPaginator.init] in thetriggersarray to enable the stop button.- The configured executor is now used for handling attachments when creating the initial responses with the ASGI bot.
- Check the headers before reading the body in the ASGI adapter and bot to avoid unnecessary hold up on bad requests.
yuyo.InteractiveButtonBuilder/yuyo.components.InteractiveButtonBuilderandyuyo.SelectMenuBuilder/yuyo.components.SelectMenuBuilder. Hikari's default implementations should be used instead.- The deprecated
load_from_attributesarguments and the relevant deprecatedas_reaction_callbackandas_component_callbackfunctions. - The deprecated
WaitForComponentalias ofWaitForExecutor.
- The [yuyo.asgi.AsgiAdapter][] and [yuyo.asgi.AsgiBot][] both now have a max body size limit to avoid
potential DoS and memory issues. This is configurable using
max_body_sizein the__init__s.
1.6.1a1 - 2023-01-17
- Detect/allow invite links which aren't prefixed by
https://orhttps://www.in [InviteLink.find][yuyo.links.BaseLink.find], [InviteLink.find_iter][yuyo.links.BaseLink.find_iter], and [InviteLink.from_link][yuyo.links.BaseLink.from_link] to better match Discord's special invite embedding logic. - All link parsers now allow
http://links. - The startup and shutdown callbacks on [yuyo.asgi.AsgiAdapter][] now take no arguments. This change does not effect startup and shutdown callbacks on [yuyo.asgi.AsgiBot][].
- The
process_lifespan_eventandprocess_requestmethods from [yuyo.asgi.AsgiAdapter][]. - [yuyo.asgi.AsgiBot][] no-longer inherits from [yuyo.asgi.AsgiAdapter][] directly but still functions as one.
1.6.0a1 - 2023-01-12
- Helper functions for converting some Hikrai modals to builder objects in [yuyo.to_builder][]. These support application commands and message components.
- Bumped minimum Hikari version to
v2.0.0.dev114.
1.5.0a1 - 2023-01-10
- Add classes and functions for handling message, webhook, invite and template links.
- Officially drop support for Python 3.8.
1.4.0a1.post1 - 2022-11-20
- [CacheStrategy.__init__][yuyo.list_status.CacheStrategy.init] now
takes two arguments
(hikari.api.Cache, hikari.ShardAware).
- [yuyo.list_status.DiscordBotListService][]'s logging when declaring per-shard stats.
- Declare bot stats per-shard instead of for the whole bot when list status is using the standard cache or event strategies.
1.4.0a1 - 2022-11-20
- A system for automatically declaring a bot's guild count on the bot lists top.gg, bots.gg and discordbotlist.com. See [yuyo.list_status][] for more information.
"asgi"feature flag for ensuring this installs with the dependencies required to run the Asgi REST bot adapter.
- [yuyo.backoff.Backoff][] now increments the internal counter regardless of whether [yuyo.backoff.Backoff.set_next_backoff][] has been called.
- [yuyo.backoff.Backoff][] now iterates over the retry counter ([int][]), starting at 0, rather than just [None][].
- [yuyo.backoff.Backoff.backoff][] now returns the current retry count as [int][] or [None][] if it has reached max retries or the finished flag has been set.
- Allow [None][] to be passed for
attachmentandattachmentsto edit response methods. - Star imports are no-longer used on the top level (at [yuyo][]) so only the attributes present
in
yuyo.__all__can be accessed there now. - [yuyo.components.AbstractComponentExecutor][],
yuyo.components.ChildActionRowExecutor,InteractiveButtonBuilder,yuyo.components.as_child_executor,yuyo.components.as_component_callback, [yuyo.reactions.AbstractReactionHandler][], andyuyo.reactions.as_reaction_callbackare no longer included inyuyo.__all__/exported top-level.
yuyo.components.as_child_executor,yuyo.components.as_component_callback, andyuyo.components.as_reaction_callbackare no longer documented (included in their relevant module's__all__) as these are considered deprecated and undocumented.
- [yuyo.backoff.Backoff.backoff][] now respects the max retires config and finished flag. For this it will now return [None][] without sleeping when either has been reached.
backoffoption from [yuyo.backoff.Backoff.backoff][] to better match the aiter flow.
1.3.1a1 - 2022-11-07
- A chunk request tracker implementation.
-
Bumped the minimum Hikari version to
2.0.0.dev112. -
[yuyo.asgi.AsgiAdapter][]'s startup and shutdown callbacks now take 1 argument, must return [None][] and must be asynchronous to match the methods added to [hikari.RESTBotAware][hikari.traits.RESTBotAware] in https://github.com/hikari-py/hikari/releases/tag/2.0.0.dev112.
This argument will be of type [yuyo.asgi.AsgiAdapter][] when these methods are called of an asgi adapter and of type [yuyo.asgi.AsgiBot][] when called on an asgi bot instance.
replace_attachmentsargument from the relevant context edit response methods. For more information see https://github.com/hikari-py/hikari/releases/tag/2.0.0.dev112.
1.2.1a1 - 2022-11-04
ephemeralkeyword-argument to [yuyo.components.ComponentContext][]'screate_initial_response,create_follow_upanddefermethods as a shorthand for including1 << 6in the passed flags.delete_afteroption to [yuyo.components.ComponentContext][] response methods.expires_atproperty to [yuyo.components.ComponentContext][].- Support for dependency injection through [Alluka][alluka] to the reaction and component clients.
ComponentExecutor.executenow takes a context object instead of interaction and future objects.- [yuyo.pagination.async_paginate_string][], [yuyo.pagination.sync_paginate_string][] and
[yuyo.pagination.paginate_string][] now return an (async) iterator of the [str][] pages rather than
an iterator of
tuple[str, int]. If you need page counts, use [enumerate][] or [yuyo.pagination.aenumerate][]. - (Async) iterables can now be passed to [yuyo.pagination.async_paginate_string][], [yuyo.pagination.sync_paginate_string][] and [yuyo.pagination.paginate_string][] instead of just iterators.
- [yuyo.interactions.BaseContext.respond][] trying to edit in the initial response instead of create a follow up if a deferred initial response was deleted.
- Long running
delete_afterand component execution tasks will no-longer be cancelled by GC.
- The project metadata dunder attributes from [yuyo][]. [importlib.metadata][] should be used to get this metadata instead.
1.1.1a1 - 2022-08-28
- Support for sending attachments in the initial response to the ASGI server implementation.
- Support for sending attachments on initial response to the
ComponentContext.
- Bumped the minimum hikari version to dev109.
- Async functions must be typed as returning
typing.Coroutine/collections.abc.Coroutinerather thantyping.Awaitablenow.
- Several bug fixes on handling context response tracking have been copied over from Tanjun
to
ComponentContext.
1.0.6a1 - 2022-05-24
- Bumped the minimum hikari version to dev108.
WaitForExecutornow has better semantics/behaviour around being called when it's inactive:- Timeouts are now handled better meaning that a wait for executor timeout will mark it to be de-registered.
- Execute calls to an executor that hasn't been waited for yet now return a not active message.
1.0.5a1.post1 - 2021-12-21
AsgiBotis now (by default) started and closed based on the ASGI lifespan events with theasgi_managedkeyword argument toAsgiBot.__init__allowing this to be disabled.
1.0.5a1 - 2021-12-21
AsgiBotextension forAsgiAdapterwhich can be run by itself (manages a rest client).
- Renamed
WaitForComponenttoWaitForExecutor.
1.0.4a1 - 2021-11-22
prefix_matchoption to ComponentClient custom ids to make storing metadata in custom ids possible.
- custom id methods now raise ValueError on conflict rather than KeyError.
1.0.3a1 - 2021-10-27
- An ASGI/3 adapter for Hikari's interaction server.
- Ability to register a callback for a constant custom_id in the component client. This takes precedence over any registered component executors.
- Renamed
components.WaitFortoWaitForComponentand added it tocomponents.__all__andyuyo.__all__.
Context.deferis now used in the ComponentPaginator instead ofContext.create_initial_responseto defer the initial response since before deleting it asContext.create_initial_responseerrors in the REST flow when a defer type is passed.Context.create_initial_responseis no longer typed as taking deferred types.- Handling of authors in WaitForComponent.
- Added timeout handling to the future returned by WaitForComponent.wait_for.
- ComponentClient erroneously garbage collecting unexpired executors.
- ComponentPaginator and ReactionPaginator both starting on index 1 instead of 0.
1.0.2a1 - 2021-10-02
- Option to have the ComponentClient be event managed when linked to an event manager. This is True by default.
- The client now gives a ephemeral timed out response when an unknown message is received.
- ComponentClient's gc task not being started when its opened.
- Handling of access errors in the component client.
- MultiComponentExecutor slots.
1.0.1a1 - 2021-09-21
- Higher level component execution client and a pagination specific implementation of its executor.
- Totally refactored reaction pagination client to make it more abstract and abstracted away from pagination where the pagination is just a standard use case specific implementation of its executor.
- Renamed module pagnation to pagination.
- Move the reaction handling logic over to "reactions.py"
- Renamed string_patinator functions to paginate_string
- Iffy behaviour around "locking" the reaction executor which lead to some requests just being ignored.