- 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
- 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