Version 3 Changelog¶
Below are all the changelogs for the new versions of hikari-lightbulb (version 3.0.0 to present).
v3.0.0a15 (2024-11-22)¶
Features¶
Menu.attach
now returns an instance ofMenuHandle
instead of a generic awaitable - allowing the menu to be stopped without using aMenuContext
or timeout.
Bugfixes¶
Changed logging level for exceptions happening in tasks from
WARNING
toERROR
. (#486)Fix sporadic attribute error when using
self.previous_row()
within a component menu class.
v3.0.0a14 (2024-10-30)¶
Bugfixes¶
Fixed lightbulb.attachment option, which previously compiled to hikari.OptionType.MENTIONABLE (#472)
Miscellaneous¶
Add support for Python 3.13
v3.0.0a13 (2024-09-30)¶
Features¶
Implement injection for union dependencies using
Foo | Bar
. If any of the requested dependencies are not registered, it will fall back to the next in the union.Implement injection for optional dependencies using
Foo | None
. If all the requested dependencies are not registered, it will fall back toNone
.Implement injection ‘meta annotations’ (
Try[]
andIf[]
) allowing modifying of the fall-back behaviour.
(#454)
Add
name
argument to thehook()
decorator andname
attribute toExecutionHook
.Prefab cooldown hooks now register an instance of
CommandCooldown
as a dependency when they are executed.
Bugfixes¶
Fix
KeyError
preventing error handlers being loaded from extensions.Fix menu task exceptions being logged even if they were raised previously.
v3.0.0a12 (2024-08-30)¶
Breaking Changes¶
Menu.attach
now has thewait
parameter set toTrue
by default, and thetimeout
parameter set to30s
by default.
Bugfixes¶
Fix DI creating a new default container every time instead of reusing the existing one.
Fixed DI failing when trying to create dependencies with more complex dependency trees.
v3.0.0a11 (2024-08-29)¶
Bugfixes¶
Improved container hierarchical dependency resolution process.
Add significantly more
DEBUG
logging throughout the DI pipeline.DependencyInjectionManager.enter_context
now needs to be called for every context you wish to enter; it will no longer enter the default context automatically.DependencyInjectionManager.enter_context
now searches the existing container hierarchy to find an existing container for the passed context before trying to create a new one.DependencyInjectionManager.enter_context
now returns a no-op container implementation instead ofNone
if DI is disabled globally.
(#449)
Fix default injection container being closed when explicitly entering the
DEFAULT
DI context.
Features¶
v3.0.0a10 (2024-08-15)¶
Documentation¶
Update code examples for version 3 from version 2. (#436)
Features¶
Add a component and modal handler implementation. You can use these to more easily handle the creation and execution of message components, as well as submitted modal forms. (#438)
Deprecations and Removals¶
The
ephemeral
argument forContext.defer()
is now keyword-only.
v3.0.0a9 (2024-08-08)¶
Features¶
Add
prefab
subpackage containing some simple built-in hooks. More will continue to be added.utils.get_command_data()
now works for groups and subgroups.
Miscellaneous¶
Switch to using types from
collections.abc
instead oftyping
wherever possible.
v3.0.0a8 (2024-07-29)¶
Features¶
Add
hooks
parameter toclient_from_app
- allowing commands to inherit common hooks from the client. (#430)
Bugfixes¶
Fix autocomplete callbacks not being called if the option had localization enabled.
Fix command parameter validation failing sometimes when using long localization keys.
Fix subcommands with localization enabled not being invoked as expected.
Slightly improved performance of invoking nested subcommands.
Deprecations and Removals¶
Client.register_deferred
has been removed. You should now useClient.register(defer_guilds=True)
instead.guilds
kwarg forClient.register
has new semantics. Read the docstring for more information.
(#429)
Removed
HookFailedException
.ExecutionPipelineFailedException
now has two attributes containing the hooks that failed, and the exception that caused them to fail. You may need to update your error handler to reflect this.
v3.0.0a7 (2024-07-23)¶
Features¶
Dependency injection system has been completely rewritten to make it much more flexible and powerful. See the dependencies guide on the ‘By Examples’ page for details on the new implementation. (#428)
Deprecations and Removals¶
Removed
lightbulb.with_di
, it has been replaced bylightbulb.di.with_di
Removed
lightbulb.INJECTED
, it has been replaced bylightbulb.di.INJECTED
Removed
Client.di.register_dependency
- see the dependencies guide for details on the replacement
(#428)
v3.0.0a6 (2024-07-18)¶
Features¶
Add support for unloading and atomic reloading of extensions.
Implement repeating tasks - including uniform and cron-based triggers and support within extensions.
Bugfixes¶
Fix limit for message ID length for options name and description when using
GnuLocalizationProvider
. (#427)Fix localization not being supported correctly for commands using deferred guild registration.
Deprecations and Removals¶
The
unload()
method is now required to be implemented forLoader
s.
v3.0.0a5 (2024-07-13)¶
Features¶
Refactor
ExecutionPipelineFailedException
to make writing error handlers more intuitive.
Bugfixes¶
Fix incorrect assertion error happening sometimes when a subcommand is invoked.
v3.0.0a4 (2024-07-02)¶
Features¶
Add
ephemeral
convenience argument toContext.respond
.Add ability to localize choice names.
v3.0.0a3 (2024-06-28)¶
Features¶
Add
PRE_INVOKE
execution step to default execution step order.Add ability for
Loadable.listener
s to listen for multiple event types.
Bugfixes¶
Fix not being able to access option values when their name and description are localized.
v3.0.0a2 (2024-06-20)¶
Features¶
A plugin for IntelliJ-based IDEs has been released to add autocompletion and type checking support for command parameters. It supports Lightbulb from this version and later. More features are planned.
Bugfixes¶
Use
interaction.registered_guild_id
when resolving command interactions to prevent issues where guild commands would sometimes be invoked instead of global commands. (#426)
Improved Documentation¶
Documentation has been reworked to look nicer and function better. A Lightbulb-by-example section is in-progress for better tutorials and explanations for users of the library.
v3.0.0a1 (2024-06-09)¶
Features¶
Add
lightbulb.INJECTED
flag for dependency injection typing improvements (#424)