Changelogs#
Here you can find all the changelogs for hikari-arc.
2.1.1#
- Fix breaking change in hikari
v2.3.3causing events dispatching to fail. - Fix option locale provider being invoked for slash subcommands and subgroups instead of the command locale provider.
2.1.0#
- Add
polltoContext.respond. - Adjust
Context.app_permissionstyping to match hikari, removingNonefrom the union type. - Bump hikari to
v2.2.1.
2.0.0#
- Breaking: Remove
is_dm_enabledfrom all command, plugin, and client types. Use the newly addedinvocation_contextsinstead. - Breaking: Remove deprecated
Client.set_startup_hookandClient.set_shutdown_hook. Use the newly addedClient.add_startup_hookandClient.add_shutdown_hookinstead. - Breaking: Remove
Context.get_channelandAutocompleteData.get_channel. Use the newly addedContext.channelandAutocompleteData.channelproperties instead. - Add support for user installations of commands.
- Add
invocation_contextsandintegration_typesto all command, plugin, and client types. - Add
invocation_contextandauthorizing_integration_ownerstoContextandAutocompleteData. - Add
Client.find_commandandPluginBase.find_commandto get a command by name. - Bump
hikaritov2.2.0.
Migration guide#
is_dm_enabled removal#
# Before 2.0
client = arc.GatewayClient(..., is_dm_enabled=False)
# After 2.0
# Omit hikari.ApplicationContextType.BOT_DM to disable DMs
# You may also want to remove PRIVATE_CHANNEL if you don't want to support group DMs
client = arc.GatewayClient(
...,
invocation_contexts=[
hikari.ApplicationContextType.GUILD,
hikari.ApplicationContextType.PRIVATE_CHANNEL
]
)
This applies similarly to command or plugin-level use of this setting.
set_startup_hook and set_shutdown_hook removal#
# Before 2.0
@client.set_startup_hook
async def startup_hook(client: arc.GatewayClient) -> None:
print("Client started up!")
@client.set_shutdown_hook
async def shutdown_hook(client: arc.GatewayClient) -> None:
print("Client shut down!")
# After 2.0
@client.add_startup_hook
async def startup_hook(client: arc.GatewayClient) -> None:
print("Client started up!")
@client.add_shutdown_hook
async def shutdown_hook(client: arc.GatewayClient) -> None:
print("Client shut down!")
get_channel removal#
# Before 2.0
@arc.slash_command("test", "Test command")
async def test(ctx: arc.GatewayContext) -> None:
channel = ctx.get_channel()
# After 2.0
@arc.slash_command("test", "Test command")
async def test(ctx: arc.GatewayContext) -> None:
channel = ctx.channel
1.4.0#
- Add new optiontype with converter for
hikari.Emoji. - Work around
hikaribug to solve command sync failing when a command has localizations. - Bump
hikaritov2.0.0. - Add Python 3.13 support.
v1.3.4#
- Fix included basic hooks not working due to signature parsing.
v1.3.3#
- Fix hooks defined as async callable classes not working. (For instance, limiters)
v1.3.2#
- Add
IntervalLoop.set_interval()to change the loop interval after loop creation. - Fix error handling with slash subcommands sometimes causing infinite recursion.
v1.3.1#
- Add the ability to configure if an
IntervalLoopshould run immediately after being started or not. - Fix
CronLooprunning immediately after being started.
v1.3.0#
- Deprecate
Client.set_startup_hookandClient.set_shutdown_hook. These will be removed inv2.0.0. Use the newly addedClient.add_startup_hookandClient.add_shutdown_hookinstead. - Add options with converters. These options do not exist on Discord's end, arc simply tries to convert a more primitive optiontype into the requested one, failing if it is not possible.
- Add new optiontypes with converters for
hikari.Memberandhikari.Color. - Add
arc.OptionConverterFailureErrorwhen a converter fails to convert an option value. - Add support for injecting dependencies contextually to command callbacks, hooks, and error handlers via
Client.add_injection_hookandClient.remove_injection_hook. - Add support for multiple startup & shutdown hooks via
Client.add_startup_hookandClient.add_shutdown_hookrespectively. - Inject dependencies by default into pre/post-execution hooks & error handlers.
- Fix client hooks being executed twice if a command is added to a plugin.
- Fix options mapping not taking name overrides into account.
- Bump alluka to
0.3+.
v1.2.1#
- Fix
arc.utils.global_concurrencymissing alimitargument. - Fix slash subcommands failing to resolve autodefer settings.
v1.2.0#
- Optimize command syncing by using bulk endpoints for global app commands as well, making it much faster.
- Improve command syncing error messages.
- Fix
@Client.listenand@Plugin.listenfailing to parse event types with generics from function signatures.
v1.1.0#
- Add
Client.create_taskto make it easier to create "fire and forget" tasks. - Add
Client.is_startedandClient.wait_until_startedfor more convenient lifecycle management. - Add the ability to pass an already existing injector instance to
Clientvia theinjector=kwarg. If not passed, a new injector will be created by default, like before. - Set the client as a type dependency upon instantiation.
- Stabilize
Context.issued_response. This property returns a boolean that isTrueif the underlying interaction has already received an initial response. - Fix
hikari.User | hikari.Role | Nonenot being parsed as mentionable option. - Fix edgecase where options defaulted to
Nonewould be ignored in Python 3.10.
v1.0.0#
This marks the first stable release of arc, meaning that from this point on, the project follows semantic versioning, and no breaking changes will happen (until an eventual 2.0).
- Add loops. Loops can be used to repeatedly call a given coroutine function with a specific interval or cron set.
- Add concurrency limiters. Concurrency limiters can be used to prevent users from invoking a command that already has a specific amount of instances running.
- Add
arc.StartedEventandarc.StoppingEventto gateway clients to enable managing lifecycle via events. - Fix command groups always being republished when command syncing.
In additon to these changes, the documentation got a major refresh, adding & extending guides where needed.
v0.6.0#
- Add
Context.get_option()to access options outside the command callback in a type-safe manner. - Add
Client.walk_commands()andPlugin.walk_commands()to iterate over all commands & subcommands of a given type in a type-safe manner. - Add
CallableCommandProto.display_name,SlashCommand.make_mention(),SlashSubCommand.make_mention(). - Change
Context.respond_with_builder()to attempt a followup message when the interaction has an initial response and a message builder was passed. - Remove the
acquire()method fromLimiterPrototo make it easier to implement custom limiters. - Split
arc.utils.hooks.RateLimiterintoarc.utils.RateLimiterandarc.utils.hooks.LimiterHook. This allowsarc.utils.RateLimiterto be used independently of an arc context object.
v0.5.0#
- Breaking: Re-order OptionParams object parameters.
description=is now the first & only positional argument.name=has been moved to the second parameter and is now keyword-only. - Add limiters.
- Add
autodefer,default_permissions,is_dm_enabledandis_nsfwto client & plugin types. If set, these settings will be applied to all commands added to the client/plugin. They can still however be overridden by individual commands. - Add
GatewayClientBaseandRESTClientBaseto aid in creating custom client types. Examples on how to do this have also been added to the repository. - Fix
InteractionResponse.retrieve_message()failing due to incorrect assertion. - Fix subcommands & subgroups unable to have hooks or an error handler.
v0.4.0#
- Add localization support through locale providers. See the localization example for more.
- Add
@GatewayClient.listen,GatewayClient.subscribe,GatewayClient.unsubscribe. - Add
@GatewayPlugin.listen,GatewayPlugin.subscribe,GatewayPlugin.unsubscribe. - Make all first-order decorators work as second-order decorators as well.
v0.3.0#
- Add hooks.
- Add lifecycle hooks to
Clientalong with an error handler. - Declare
attrsexplicitly as a dependency.
v0.2.0#
- Breaking: Rename
Context.edit_response()toContext.edit_initial_response(). This is to make the purpose of the function clearer. - Breaking: Remove
arc.Injected[T]typehint alias. Usearc.inject()instead. This is to avoid confusion between the two. - Breaking: Rename
GatewayPlugintoGatewayPluginBaseandRESTPlugintoRESTPluginBase. - Add
GatewayContextaliasingContext[GatewayClient] - Add
RESTContextaliasingContext[RESTClient] - Add
GatewayPluginaliasingGatewayPluginBase[GatewayClient] - Add
RESTPluginaliasingRESTPlugin[RESTClient] - Add support for passing mappings to
choices=when specifying option params. - Move
ABCs used internally underarc.abc. - Improve handling missing responses via REST by adding
NoResponseIssuedError. - Fix
@plugin.inject_dependenciesfailing when located outside of the main module.
v0.1.3#
- Fix
Context.respond_with_builderissuing the response twice in REST. - Do not export
abcs to top-level.
v0.1.2#
- Add
Context.respond_with_modal - Add
BoolOptionandBoolParams - Improve
Context.respond_with_buildertyping.
v0.1.1#
- Initial release