Hooks
The hooks
builder allows you to register blocks of code to be executed at various stages of your bot's lifecycle. This has a number of important use-cases, which will be explored below.
Builders
The following builders relate to extension loading states.
Name | Receiver | Description |
---|---|---|
|
| Run during startup, before any registered extensions are loaded. |
| Run whenever an extension is loaded, at any point in the bot's lifecycle. | |
|
| Run during startup, after all registered extensions are loaded. |
The following builders relate to Koin setup progress. You can learn more about Koin in our dedicated Koin documentation, which explains how you should use it and what Kord Extensions does differently to the norm.
Name | Description |
---|---|
| Run during startup, after Koin has been started, but before the default Koin modules have been registered. This is a great place to register any extra Koin modules you'll need. |
| Run during startup, after the default Koin modules have been registered. |
The following builders relate to the bot lifecycle itself.
Name | Receiver | Description |
---|---|---|
|
| Run during startup, right after the |
|
| Run during startup, right after the |
|
| Run during startup, just before the |
Properties
Name | Type | Default | Description |
---|---|---|---|
|
|
| Whether to register Kord's shutdown hook, which formally disconnects from the gateway when the process shuts down. |