Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ChannelCache

Cache responsible for storing channel related data

Hierarchy

Index

Methods

addToIndex

  • addToIndex(id: string): Promise<void>
  • Add channels to the channel index

    Parameters

    • id: string

      ids of the channels

    Returns Promise<void>

bindGuild

  • Bind a guild id to the cache

    Parameters

    • guildId: string

      id of the guild that should be bound to this cache

    Returns ChannelCache

bindObject

buildId

  • buildId(id: string): string
  • Build an id consisting of $namespace.$id

    Parameters

    • id: string

      id to append to namespace

    Returns string

    constructed id

filter

find

  • find(fn: (channel?: ChannelData) => unknown, channelMap: string[]): Promise<null | ChannelCache>
  • Filter through the collection of channels and return on the first result

    Parameters

    • fn: (channel?: ChannelData) => unknown

      Filter function

        • (channel?: ChannelData): unknown
        • Parameters

          • Optional channel: ChannelData

          Returns unknown

    • channelMap: string[]

      Array of ids used for the filter

    Returns Promise<null | ChannelCache>

    First result bound to a channel cache

get

getIndexCount

  • Get the number of channels that are currently cached

    Returns Promise<number>

    Number of channels currently cached

getIndexMembers

  • getIndexMembers(): Promise<string[]>

isIndexed

  • isIndexed(id: string): Promise<boolean>

remove

removeFromIndex

  • removeFromIndex(id: string): Promise<void>
  • Remove a channel from the index

    Parameters

    • id: string

      id of the channel

    Returns Promise<void>

removeIndex

structurize

  • structurize<D>(data: Partial<D>): Partial<D>
  • Delete keys from data if necessary based on RainCache structureDefs options and return the cleaned data

    Type parameters

    • D

    Parameters

    • data: Partial<D>

      The data to possibly delete object entries from

    Returns Partial<D>

update

Properties

Optional boundGuild

boundGuild?: string

guild id bound to this cache

boundObject

channelMap

channelMap: ChannelMapCache

dataTimestamp

dataTimestamp: null | Date = null

Optional guild_id

guild_id?: string

namespace

namespace: "channel" = "channel"

permissionOverwriteCache

permissionOverwriteCache: PermissionOverwriteCache

Optional permission_overwrites

permission_overwrites?: { id: string }[]

rain

rain: RainCache<any, any>

recipientCache

recipientCache: UserCache

Optional recipients

recipients?: UserData[]

storageEngine

Constructors

constructor

Generated using TypeDoc