BApplicationConfigBuilder

Properties

Link copied to clipboard

Mappings between the base bundle name and the locales it supports.

Link copied to clipboard

Configuration of the application commands cache.

Link copied to clipboard
open override var diffEngine: DiffEngine

The diff engine to use when comparing old and new application commands, to determine if commands needs to be updated.

Link copied to clipboard
@set:JvmName(name = "disableAutocompleteCache")
open override var disableAutocompleteCache: Boolean

Disables autocomplete caching, unless CacheAutocomplete.forceCache is set to true.

Link copied to clipboard
@set:JvmName(name = "enable")
open override var enable: Boolean

Whether application commands should be listened for.

Link copied to clipboard
@set:JvmName(name = "forceGuildCommands")
open override var forceGuildCommands: Boolean

Sets whether all application commands should be guild-only, regardless of the command scope on the annotation.

Link copied to clipboard

Whether the raw JSON of the application commands should be logged when an update is required.

Link copied to clipboard

Whether to log a WARN if a localization key isn't found when registering the commands.

Link copied to clipboard
@set:JvmName(name = "enableOnlineAppCommandChecks")
open override var onlineAppCommandCheckEnabled: Boolean

Enables the library to compare local commands against Discord's command, to check if application commands need to be updated.

Link copied to clipboard
open override val slashGuildIds: MutableList<Long>

If not empty, only these guilds will have their application commands updated.

Link copied to clipboard
open override val testGuildIds: MutableList<Long>

Test guilds IDs for all commands annotated with Test

Functions

Link copied to clipboard
fun addLocalizations(bundleName: String, vararg locales: DiscordLocale)
fun addLocalizations(bundleName: String, locales: List<DiscordLocale>)

Adds the specified bundle names with its locales; those bundles will be used for command localization (name, description, options, choices...).

Link copied to clipboard

Configures a cache for application commands, stored in the database supplied by ConnectionSupplier.

Link copied to clipboard

Entirely disables the application commands cache, meaning the application commands will always be updated on startup.

Link copied to clipboard
fun fileCache(path: Path = getDefaultCachePath(), block: ReceiverConsumer<FileApplicationCommandsCacheConfigBuilder> = ReceiverConsumer.noop())

Configures a file-based cache for application commands, which helps avoid request to Discord as commands do not need to be updated most of the time.