Kord Extensions Help

Cache

The cache builder allows you to change Kord's caching settings. Kord Extensions provides some additional default settings over Kord's own:

  • Configures a lruCache for caching up to 10,000 recent messages

  • Changes the default caching strategy to cacheWithCachingRestFallback, which means that Kord will cache all entities that are retrieved via REST calls in addition to hose provided by the gateway.

ExtensibleBot(TOKEN) { // ... cache { cachedMessages = 10_000 defaultStrategy = EntitySupplyStrategy.cacheWithCachingRestFallback } }

Builders

Builder

Receiver

Parameters

Description

kord

KordCacheBuilder

ClientResources

Register a callback that will be used to directly configure Kord's cache.

transformCache

Kord

DataCache

Register a callback that will be used to directly modify Kord's data cache settings.

Properties

Name

Type

Default

Description

cachedMessages

Int?

10,000

Number of recent messages Kord's cache should store by default. Use null to disable.

defaultStrategy

EntitySupplyStrategy

cacheWithCachingRestFallback

Kord's default caching strategy.

Last modified: 20 November 2024