Hooks
The hooks { } builder allows you to register blocks of code to be run at various stages of your bot's lifecycle.
Hooks
Bot-Related Hooks
Run during startup, just before the bot's ExtensibleBot object tires to connect to Discord.
This hook will run again if you stop and restart the ExtensibleBot object using the relevant functions.
Run during startup, right after the bot's ExtensibleBot object has created, and before it has been set up.
Run during startup, right after the bot's ExtensibleBot object has been set up.
Extension-Related Hooks
Run during startup, after the bot loads any registered extensions.
Run during startup, before the bot loads any registered extensions.
Run after an extension is loaded, regardless of where the bot is in its lifecycle.
The extension that was just loaded.
Koin-Related Hooks
These builders relate to Koin and how Kord Extensions manages it. For more information about Koin (and what we do differently with it), please see [the Koin page].
Run during startup, after the default Koin modules have been registered.
This is a great place to register any extra Koin modules your bot needs.
Run during startup, after Kord Extensions starts Koin, but before the default Koin modules have been registered.
Settings
Whether to register Kord's shutdown hook.
This hook formally disconnects your bot from Discord's gateway when the bot's process shuts down. We don't recommend disabling this unless you run into a serious, related problem.