Class

MessageCache

Per-channel message cache with FIFO eviction.

  • false limit → caching disabled
  • Infinity / unbounded → no per-channel cap
  • positive → max messages per channel

Outer map of channel caches is itself FIFO-bounded by getChannelLimit. get never creates empty maps (use add).

Constructor

new MessageCache(getLimit: () => MessageLimit, getChannelLimit: () => number)
getLimit
() => MessageLimit
getChannelLimit
() => number

Methods

.get(channelId)

channelId: stringMap<string, APIMessage> | null

Return the existing per-channel map, or null if disabled / not yet created. Does **not** create empty maps.

messageCache.get(channelId);