Cache Autocomplete
annotation class CacheAutocomplete(val cacheMode: AutocompleteCacheMode = AutocompleteCacheMode.CONSTANT_BY_KEY, val forceCache: Boolean = false, val cacheSize: Long = 2048, val compositeKeys: Array<String> = [], val guildLocal: Boolean = false, val userLocal: Boolean = false, val channelLocal: Boolean = false)(source)
Enables autocomplete caching.
By default, this will cache results by key, which is the input of the focused option.
However, you can use composite keys if you want to cache based off multiple option values, see compositeKeys for more details.
See also
@SlashOption
@AutocompleteHandler
DSL equivalent
Properties
Link copied to clipboard
Sets the autocomplete cache mode.
Link copied to clipboard
Defines whether this autocomplete will give different results based on which Channel this interaction is executing on.
Link copied to clipboard
The set of option names (the one you see on Discord) which forms the cache key.
Link copied to clipboard
Whether the cache should be used even if autocomplete cache is disabled.
Link copied to clipboard
Defines whether this autocomplete will give different results based on which Guild this interaction is executing on.