Changelog#
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.
Unreleased#
1.23.1 - 2024-10-07#
Changed#
- Support Python 3.13
1.23.0 - 2024-07-14#
Added#
- BaseContext.alluka property for getting the context's alluka client.
Changed#
- pagination.ResponseKwargs is now publicly exported to allow 3rd party implementations of AbstractPage.ctx_to_kwargs and AbstractPage.to_kwargs to have properly typed return types.
- pagination.ResponseKwargs's fields are now all marked as not required.
1.22.0 - 2024-07-11#
Added#
- Support for component pagination based on global ("static") bot data. More information on this can be found here.
Deprecated#
yuyo.components.BaseContextas this has been moved to yuyo.interactions.BaseContext.
1.21.1 - 2024-04-29#
Changed#
- 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#
Added#
- Component StreamExecutor for streaming over received component contexts.
- Support for specifying specific component IDs for WaitForExecutor.
1.20.0 - 2024-03-29#
Added#
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#
Added#
- Support for Python 3.12.
1.19.0 - 2023-08-30#
Added#
- ComponentClient.get_executor method for getting the executor registered globally for a specific custom ID.
Changed#
- The ephemeral default is now ignored for message update create initial response and defer calls. (This likely won't effect real world behaviour).
Fixed#
- Explicitly passing
ephemeral=Falseto create_initial_response or 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#
Added#
- yuyo.components.builder (a class descriptor), ActionColumnExecutor.add_builder, and ActionColumnExecutor.add_static_builder functions and methods for adding raw component builders to a column without an associated callback.
Changed#
- yuyo.pagination.Page is now exported top-level at
Yuyo.Page.
Fixed#
- Properly track method names for callbacks registered using as_interactive_button. This allows the custom ID metadata to be overridden by passing
id_metadata={"function_name": "METADATA"}to ActionColumnExecutor.__init__.
1.17.0 - 2023-08-18#
Added#
- Wait for implementation for modals.
Changed#
- 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.
Fixed#
- Timed out individual requests will no-longer lead to the chunk tracker crashing.
1.16.0 - 2023-08-11#
Added#
- yuyo.InteractionError error type which can be used to end modal and component interactions with a message.
Fixed#
- ComponentClient.from_tanjun and ModalClient.from_tanjun both now correctly pass through the relevant hikari bot components.
1.15.0 - 2023-08-10#
Added#
- 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.ComponentContext, yuyo.ModalClient, and yuyo.ModalContext which represent parts of the linked Hikari bot in a similar style to tanjun.- The following utility attributes to yuyo.ComponentContext and yuyo.ModalContext which mostly relay attributes from the inner interaction:
.author,.channel_id,.created_at,.guild_id,.member,.shard.
1.14.2 - 2023-05-08#
Fixed#
- The fields for a ModalOptions are now correctly tracked when added to a Modal instance and are no-longer erroneously tracked as static fields for
type(modal).
1.14.1 - 2023-05-03#
Changed#
- 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 now raises a
KeyErrorif the component isn't registered to better match the other deregister methods.
Removed#
- Erroneous
prefix_matchparameter from yuyo.modals.with_text_input which should've been removed inv1.14.0
1.14.0 - 2023-05-03#
Added#
authorsoption to components.ActionColumnExecutor.__init__.- Functions for generating Discord Oauth2 authorize links and bot invite links to yuyo.links.
- ActionColumnExecutor.with_interactive_button.
- ActionColumnExecutor.with_static_interactive_button.
- ActionColumnExecutor.with_mentionable_menu.
- ActionColumnExecutor.with_static_mentionable_menu.
- ActionColumnExecutor.with_role_menu.
- ActionColumnExecutor.with_static_role_menu.
- ActionColumnExecutor.with_user_menu.
- ActionColumnExecutor.with_static_user_menu.
- ActionColumnExecutor.with_channel_menu.
- ActionColumnExecutor.with_text_menu.
- ActionColumnExecutor.with_static_text_menu.
- yuyo.components.column_template shorthand function for creating a column subclass.
Changed#
- 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__ 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.
Fixed#
- ActionColumnExecutor and Modal both now properly relay
__init_subclass__keyword arguments when being used in mixed inheritance.
Removed#
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, and ActionColumnExecutor.add_static_select_menu.
timeoutkeyword argument from ComponentExecutor.__init__, ActionColumnExecutor.__init__, and ComponentPaginator.__init__.prefix_matchkeyword argument from Modal.add_static_text_input, Modal.add_text_input, modals.with_static_text_input, modals.with_text_input, and 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#
Added#
- components.Paginator alias of components.ComponentPaginator.
- reactions.Handler alias of reactions.ReactionHandler.
- reactions.Paginator alias of reactions.ReactionPaginator.
Changed#
- ComponentPaginator now implements 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.
Deprecated#
yuyo.components.ActionRowExecutorin favour of the action column executor.ActionColumnExecutor.add_row.
Fixed#
- reactions.Client now correctly points towards 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.
Removed#
timeoutargument from ComponentPaginator.__init__."WaitFor"fromyuyo.components.__all__.
1.12.0a1 - 2023-04-24#
Added#
ephemeral_defaultoption to ActionColumnExecutor.__init__.- Shorthand methods and functions for adding/declaring mentionable, role and user menus:
- components.as_mentionable_menu
- components.as_role_menu
- components.as_user_menu
- ActionColumnExecutor.add_mentionable_menu
- ActionColumnExecutor.add_static_mentionable_menu
- ActionColumnExecutor.add_role_menu
- ActionColumnExecutor.add_static_role_menu
- ActionColumnExecutor.add_user_menu
- ActionColumnExecutor.add_static_user_menu
ActionRowExecutor.add_mentionable_menuActionRowExecutor.add_role_menuActionRowExecutor.add_user_menu
Changed#
- ActionColumnExecutor now allows overriding inherited component class descriptors.
- The
add_staticmethods on ActionColumnExecutor now override any previously added sub-component with the same match ID rather than append a duplicate entry.
Fixed#
- ActionColumnExecutor now respects the order component descriptors were defined in on the class.
1.11.2a1 - 2023-04-10#
Added#
- Support for parsing message links to yuyo.links.
Changed#
- 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 fields), if set.
- Renamed the link get and fetch methods:
InviteLink.fetchto InviteLink.fetch_inviteInviteLink.getto InviteLink.get_inviteMessageLink.fetchto MessageLink.fetch_messageMessageLink.getto MessageLink.get_messageTemplateLink.fetchto TemplateLink.fetch_templateWebhookLink.fetchto WebhookLink.fetch_webhook
Fixed#
- ModalOptions attributes now correctly expose the values passed to the modal rather than internal descriptors.
- 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 and AsgiBot.close will now call the startup and shutdown callbacks respectively when
asgi_managed=False.
1.11.1a1 - 2023-04-05#
Changed#
callbackandtypehave been flipped (makingtypethe first argument andcallbackthe second one) for the following functions:ActionRowExecutor.add_select_menu- ActionColumnExecutor.add_select_menu
- ActionColumnExecutor.add_static_select_menu
with_static_select_menu
- Renamed the component context select menu data properties:
ComponentContext.select_channelsto ComponentContext.selected_channelsComponentContext.select_rolesto ComponentContext.selected_rolesComponentContext.select_textsto ComponentContext.selected_textsComponentContext.select_usersto ComponentContext.selected_usersComponentContext.select_membersto ComponentContext.selected_members
Deprecated#
- Passing
callbackas the first argument when adding a select menu to a component executor or column. - The
with_{}methods on yuyo.components.ActionColumnExecutor.
Fixed#
- 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 now defaults to unlimited uses instead of 1 use.
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_menudecorator for declaring a static text select menu on a 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 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 incustom_id. id_metadataoption 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. (onlyyuyo.modals.AbstractTimeoutwas 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
authorsfield is now optional (defaulting to public) for WaitForExecutor.__init__, ComponentPaginator.__init__, and ReactionPaginator.__init__. - Renamed
yuyo.timeouts.BasicTimeoutto yuyo.timeouts.SlidingTimeout. - Renamed
ModalClient.set_modalto Modal.register_modal. - Renamed
ModalClient.remove_modalto Modal.deregister_modal. - Renamed
ComponentClient.get_executorto ComponentClient.get_executor_for_message. - Renamed
ComponentClient.remove_executorto 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
Deprecated#
- The constant ID component handling system. This has been replaced with passing yuyo.components.SingleExecutor to ComponentClient.register_executor.
- Passing
timeoutto ComponentExecutor.__init__,ActionRowExecutor.__init__, ActionColumnExecutor.__init__, and ComponentPaginator.__init__. This has been replaced by passingtimeoutto 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.ActionRowExecutortoActionColumnExecutor.add_row. This now takes hikari.api.MessageActionRowBuilder. - The
prefix_matchparameter as this is now always enabled.
Removed#
yuyo.modals.NoDefault.
1.10.1a1 - 2023-03-25#
Added#
- Some convenience properties to 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.
Changed#
- 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.
Fixed#
- 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#
Added#
- Support for declaring modal options in the modal callback's signature.
Changed#
- Moved
yuyo.modals.AbstractTimeout,yuyo.modals.BasicTimeoutandyuyo.modals.NeverTimeoutto new yuyo.timeouts module.
Deprecated#
yuyo.modals.AbstractTimeout,yuyo.modals.BasicTimeoutandyuyo.modals.NeverTimeoutas deprecated aliases
Fixed#
- Modals now correctly default to a timeout duration of 10 seconds rather than 10 days.
Removed#
- 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#
Added#
- Re-exposed
yuyo.reactions.EventTas yuyo.reactions.ReactionEventT.
Changed#
token_typenow defaults to"Bot"when a string token is passed for AsgiBot.__init__.
Fixed#
- 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#
Added#
from_tanjunconvenience classmethods for initialising from a Tanjun client to ComponentClient, ModalClient, ReactionClient, and ServiceManager.allukakeyword-argument to tofrom_gateway_botandfrom_rest_botmethods on ComponentClient, ModalClient, and ReactionClient.
Changed#
timeoutis now keyword-only for ChunkTracker.__init__.- The Alluka bound clients (ComponentClient, ModalClient, and ReactionClient) now all register themselves as type dependencies when they're not passed a 3rd party client.
Fixed#
- Prefix matched custom IDs are now correctly lower priority for modals.
- AsgiBot.remove_shutdown_callback and AsgiBot.remove_startup_callback now raise a ValueError if the callback isn't registered (as per the documented behaviour) instead of silently passing.
Removed#
- 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#
Fixed#
- 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#
Added#
timeoutconfig to ChunkTracker.__init__.bot_managedconfig to ComponentClient.from_rest_bot.- 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.
Changed#
- The
response_typeargument is now keyword only and defaults to ResponseType.MESSAGE_CREATE in ComponentContext.create_initial_response. - The
defer_typeargument is now keyword only and defaults to ResponseType.DEFERRED_MESSAGE_CREATE in ComponentContext.defer.
Deprecated#
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.
Fixed#
- The
add_{}_buttonmethods on ComponentPaginator now ignoreemojiwhenlabelis passed to avoid erroring when users don't explicitly unset the default foremoji.
Removed#
- The
AbstractReactionHandler.last_triggeredandReactionHandler.timeoutproperties as these were leaking impl detail.
1.7.0a1 - 2023-02-14#
Added#
- 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.
Changed#
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 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__ and 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. - ReactionClient.set_handler's arguments are now all positional-only.
- ComponentPaginator.get_next_entry and 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 to the create message or execute webhook REST method as
**kwargs.
Fixed#
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__ and 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.
Removed#
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.
Security#
- 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#
Changed#
- Detect/allow invite links which aren't prefixed by
https://orhttps://www.in InviteLink.find, InviteLink.find_iter, and InviteLink.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.
Removed#
- 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#
Added#
- Helper functions for converting some Hikrai modals to builder objects in yuyo.to_builder. These support application commands and message components.
Changed#
- Bumped minimum Hikari version to
v2.0.0.dev114.
1.5.0a1 - 2023-01-10#
Added#
- Add classes and functions for handling message, webhook, invite and template links.
Changed#
- Officially drop support for Python 3.8.
1.4.0a1.post1 - 2022-11-20#
Changed#
- CacheStrategy.__init__ now takes two arguments
(hikari.api.Cache, hikari.ShardAware).
Fixed#
- 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#
Added#
- 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.
Changed#
- 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.
Deprecated#
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.
Fixed#
- 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.
Removed#
backoffoption from yuyo.backoff.Backoff.backoff to better match the aiter flow.
1.3.1a1 - 2022-11-07#
Added#
- A chunk request tracker implementation.
Changed#
- 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 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.
Removed#
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#
Added#
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 to the reaction and component clients.
Changed#
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.
Fixed#
- 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.
Removed#
- The project metadata dunder attributes from yuyo. importlib.metadata should be used to get this metadata instead.
1.1.1a1 - 2022-08-28#
Added#
- Support for sending attachments in the initial response to the ASGI server implementation.
- Support for sending attachments on initial response to the
ComponentContext.
Changed#
- Bumped the minimum hikari version to dev109.
- Async functions must be typed as returning
typing.Coroutine/collections.abc.Coroutinerather thantyping.Awaitablenow.
Fixed#
- Several bug fixes on handling context response tracking have been copied over from Tanjun to
ComponentContext.
1.0.6a1 - 2022-05-24#
Changed#
- Bumped the minimum hikari version to dev108.
Fixed#
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#
Changed#
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#
Added#
AsgiBotextension forAsgiAdapterwhich can be run by itself (manages a rest client).
Changed#
- Renamed
WaitForComponenttoWaitForExecutor.
1.0.4a1 - 2021-11-22#
Added#
prefix_matchoption to ComponentClient custom ids to make storing metadata in custom ids possible.
Fixed#
- custom id methods now raise ValueError on conflict rather than KeyError.
1.0.3a1 - 2021-10-27#
Added#
- 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.
Changed#
- Renamed
components.WaitFortoWaitForComponentand added it tocomponents.__all__andyuyo.__all__.
Fixed#
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.
[1.0.2a1.post1] - 2021-10-02#
Fixed#
- ComponentClient erroneously garbage collecting unexpired executors.
- ComponentPaginator and ReactionPaginator both starting on index 1 instead of 0.
1.0.2a1 - 2021-10-02#
Added#
- Option to have the ComponentClient be event managed when linked to an event manager. This is True by default.
Changed#
- The client now gives a ephemeral timed out response when an unknown message is received.
Fixed#
- 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#
Added#
- Higher level component execution client and a pagination specific implementation of its executor.
Changed#
- 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
Fixed#
- Iffy behaviour around "locking" the reaction executor which lead to some requests just being ignored.