ExtensibleBotBuilder

Builder class used for configuring and creating an ExtensibleBot.

This is a one-stop-shop for pretty much everything you could possibly need to change to configure your bot, via properties and a bunch of DSL functions.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Whether to add KordEx's default health-checks. Defaults to true.

Link copied to clipboard

The number of threads to use for autocomplete event coroutines.

Link copied to clipboard

The bot's version. Set this yourself manually or use the KordEx Gradle plugin.

Link copied to clipboard

Called to create an ExtensibleBot, can be set to the constructor of your own subtype if needed.

Link copied to clipboard
var dataCollectionMode: DataCollection

Data collection mode, usually configured in other ways, but you may override that configuration here.

Link copied to clipboard

Whether the bot is running in development mode.

Link copied to clipboard

The number of threads to use for interaction event coroutines.

Link copied to clipboard
var koinLogLevel: Level

Logging level Koin should use, defaulting to ERROR.

Functions

Link copied to clipboard
suspend fun about(builder: suspend AboutBuilder.() -> Unit)

DSL function used to configure information about the bot.

Link copied to clipboard
suspend fun applicationCommands(builder: suspend ApplicationCommandsBuilder.() -> Unit)

DSL function used to configure the bot's application command options.

Link copied to clipboard
suspend fun cache(builder: suspend CacheBuilder.() -> Unit)

DSL function used to configure the bot's caching options.

Link copied to clipboard
suspend fun chatCommands(builder: suspend ChatCommandsBuilder.() -> Unit)

DSL function used to configure the bot's chat command options.

Link copied to clipboard
suspend fun components(builder: suspend ComponentsBuilder.() -> Unit)

DSL function used to configure the bot's components system.

Link copied to clipboard
fun customKordBuilder(builder: suspend (token: String, builder: suspend KordBuilder.() -> Unit) -> Kord)

Function allowing you to specify a callable that constructs and returns a Kord instance. This can be used to specify your own Kord subclass, if you need to - but shouldn't be a replacement for registering a kord configuration builder.

Link copied to clipboard
fun dataAdapter(builder: () -> DataAdapter<*>)

Call this to register a custom data adapter class. Generally you'd pass a constructor here, but you can also provide a lambda if needed.

Link copied to clipboard

Register the message builder responsible for formatting error responses, which are sent to users during command and component body execution.

Link copied to clipboard
open suspend fun extensions(builder: suspend ExtensionsBuilder.() -> Unit)

DSL function used to configure the bot's extension options, and add extensions. Calls to this function do not run immediately, so that plugins can be loaded beforehand.

Link copied to clipboard
suspend fun hooks(builder: suspend HooksBuilder.() -> Unit)

DSL function used to insert code at various points in the bot's lifecycle.

Link copied to clipboard
suspend fun i18n(builder: suspend I18nBuilder.() -> Unit)

DSL function used to configure the bot's i18n settings.

Link copied to clipboard
fun intents(addDefaultIntents: Boolean = true, addExtensionIntents: Boolean = true, builder: Intents.Builder.() -> Unit)

DSL function used to configure the bot's intents.

Link copied to clipboard
fun kord(builder: suspend KordBuilder.() -> Unit)

DSL function allowing for additional Kord configuration builders to be specified, allowing for direct customisation of the Kord object.

Link copied to clipboard
fun kordEventFilter(predicate: suspend Event.() -> Boolean)

Set an event-filtering predicate, which may selectively prevent Kord-created events from being processed by returning false.

Link copied to clipboard
fun kordExEventFilter(predicate: suspend Event.() -> Boolean)

Set an event-filtering predicate, which may selectively prevent KordEx-created events from being processed by returning false.

Link copied to clipboard
suspend fun members(builder: suspend MembersBuilder.() -> Unit)

DSL function used to configure the bot's member-related options.

Link copied to clipboard
suspend fun plugins(builder: suspend PluginBuilder.() -> Unit)

DSL function used to configure the bot's plugin loading options.

Link copied to clipboard
fun presence(builder: PresenceBuilder.() -> Unit)

DSL function used to configure the bot's initial presence.

Link copied to clipboard
fun sharding(shards: (recommended: Int) -> Shards)

DSL function used to configure the bot's sharding settings.