Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GuildMemberRoleStore

The store for member roles.

since

0.0.1

Hierarchy

  • ProxyCache<string, Role>
    • GuildMemberRoleStore

Implements

Index

Constructors

constructor

Properties

Private #private

#private: any

Readonly client

client: Client

The client this store belongs to.

since

0.0.1

Readonly member

member: GuildMember

The guild member this store belongs to.

since

0.0.1

Accessors

[Symbol.toStringTag]

  • get [Symbol.toStringTag](): string

first

  • get first(): [string, Role] | null
  • The first item in this Cache

    Returns [string, Role] | null

firstKey

  • get firstKey(): string | null
  • The first key of this cache

    Returns string | null

firstValue

  • get firstValue(): Role | null
  • The first value of this cache

    Returns Role | null

guild

highest

  • get highest(): Role | undefined

last

  • get last(): [string, Role] | null
  • The last item in this cache

    Returns [string, Role] | null

lastKey

  • get lastKey(): string | null
  • The last key of this cache

    Returns string | null

lastValue

  • get lastValue(): Role | null
  • The last value of this cache

    Returns Role | null

size

  • get size(): number
  • Returns the number of keys in the proxy.

    Returns number

Static [Symbol.species]

  • get [Symbol.species](): typeof ProxyCache

Methods

[Symbol.iterator]

  • [Symbol.iterator](): IterableIterator<[string, Role]>
  • Returns a new Iterator object that contains the [key, value] pairs for each element in the {@link Map} object contained in the proxy in insertion order.

    Returns IterableIterator<[string, Role]>

add

  • add(roleID: string, requestOptions?: RequestOptions): Promise<this>

clear

  • clear(): this

clone

  • clone(): ProxyCache<string, Role>

concat

  • concat(...caches: Cache<string, Role>[]): Cache<string, Role>
  • Returns a new Cache with this and other caches together

    Parameters

    • Rest ...caches: Cache<string, Role>[]

      Other caches to include in the new cache

    Returns Cache<string, Role>

delete

  • delete(key: string): boolean
  • Removes a key from the proxy.

    Parameters

    • key: string

      The key of the element to remove from the proxy object.

    Returns boolean

    Whether or not the key was removed.

entries

  • entries(): IterableIterator<[string, Role]>
  • Returns a new Iterator object that contains the [key, value] pairs for each element in the {@link Map} object contained in the proxy in insertion order.

    Returns IterableIterator<[string, Role]>

equals

  • equals(cache: Cache<string, Role>): boolean
  • Naive equality compare function

    Parameters

    • cache: Cache<string, Role>

      The cache to compare this against

    Returns boolean

every

  • every(fn: (value: Role, key: string, map: this) => boolean, thisArg?: any): boolean
  • Tests if every entry in this cache meets a condition

    Parameters

    • fn: (value: Role, key: string, map: this) => boolean

      The function to test the condition

        • (value: Role, key: string, map: this): boolean
        • Parameters

          • value: Role
          • key: string
          • map: this

          Returns boolean

    • Optional thisArg: any

      Optional binding for the fn param

    Returns boolean

filter

  • filter(fn: (value: Role, key: string, map: this) => boolean, thisArg?: any): Cache<string, Role>
  • Returns a new filtered Cache based on the filter function

    Parameters

    • fn: (value: Role, key: string, map: this) => boolean

      Function used to determine what entries are in the new Cache

        • (value: Role, key: string, map: this): boolean
        • Parameters

          • value: Role
          • key: string
          • map: this

          Returns boolean

    • Optional thisArg: any

      Optional binding for the fn param

    Returns Cache<string, Role>

find

  • find(fn: (value: Role, key: string, map: this) => boolean, thisArg?: any): [string, Role] | undefined
  • Finds an entry from this Cache

    Parameters

    • fn: (value: Role, key: string, map: this) => boolean

      Function used to find what you are looking for

        • (value: Role, key: string, map: this): boolean
        • Parameters

          • value: Role
          • key: string
          • map: this

          Returns boolean

    • Optional thisArg: any

      Optional binding for the fn param

    Returns [string, Role] | undefined

findKey

  • findKey(fn: (value: Role, key: string, map: this) => boolean, thisArg?: any): string | undefined
  • Finds a key from this Cache

    Parameters

    • fn: (value: Role, key: string, map: this) => boolean

      Function used to find what you are looking for

        • (value: Role, key: string, map: this): boolean
        • Parameters

          • value: Role
          • key: string
          • map: this

          Returns boolean

    • Optional thisArg: any

      Optional binding for the fn param

    Returns string | undefined

findValue

  • findValue(fn: (value: Role, key: string, map: this) => boolean, thisArg?: any): Role | undefined
  • Finds a value from this Cache

    Parameters

    • fn: (value: Role, key: string, map: this) => boolean

      Function used to find what you are looking for

        • (value: Role, key: string, map: this): boolean
        • Parameters

          • value: Role
          • key: string
          • map: this

          Returns boolean

    • Optional thisArg: any

      Optional binding for the fn param

    Returns Role | undefined

forEach

  • forEach(callbackfn: (value: Role, key: string, map: Map<string, Role>) => void, thisArg?: unknown): void
  • Executes a provided function once per each key/value pair in the {@link Map} object, in insertion order

    Parameters

    • callbackfn: (value: Role, key: string, map: Map<string, Role>) => void

      Function to execute for each element.

        • (value: Role, key: string, map: Map<string, Role>): void
        • Parameters

          • value: Role
          • key: string
          • map: Map<string, Role>

          Returns void

    • Optional thisArg: unknown

      Value to use as this when executing callback.

    Returns void

get

  • get(key: string): Role
  • Returns a specified element from a Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map object

    Parameters

    • key: string

      The key of the element to return from the {@link Map} object.

    Returns Role

    The element associated with the specified key, or undefined if the key can't be found in the {@link Map} object.

has

  • has(key: string): boolean
  • Returns a boolean indicating whether an element with the specified key exists or not.

    Parameters

    • key: string

      The key of the element to test for presence in the proxy and in the {@link Map} object.

    Returns boolean

    Whether or not an element with the specified key exists in the proxy and in the {@link Map} object.

keys

  • keys(): IterableIterator<string>
  • Returns a new Iterator object that contains the keys for each element in the {@link Map} object contained in the proxy in insertion order

    Returns IterableIterator<string>

map

  • map<T>(fn: (value: Role, key: string, map: this) => T, thisArg?: any): T[]
  • Maps this Cache to an array (like Array#map())

    Type parameters

    • T

    Parameters

    • fn: (value: Role, key: string, map: this) => T

      Function to determine what is mapped to the new Array

        • (value: Role, key: string, map: this): T
        • Parameters

          • value: Role
          • key: string
          • map: this

          Returns T

    • Optional thisArg: any

      Optional binding for the fn param

    Returns T[]

modify

  • modify(roles: keyof string[], requestOptions?: RequestOptions): Promise<this>

reduce

  • reduce<I>(fn: (accumulator: I, value: Role, key: string, map: this) => I, initialValue: I, thisArg?: any): I
  • Reduces this cache into a singularity

    Type parameters

    • I

    Parameters

    • fn: (accumulator: I, value: Role, key: string, map: this) => I

      The function to determine how this Cache is reduced

        • (accumulator: I, value: Role, key: string, map: this): I
        • Parameters

          • accumulator: I
          • value: Role
          • key: string
          • map: this

          Returns I

    • initialValue: I

      The initial value

    • Optional thisArg: any

      Optional binding for the fn param

    Returns I

remove

  • remove(roleID: string, requestOptions?: RequestOptions): Promise<this>

set

  • set(key: string): this
  • Adds a key to the proxy if it wasn't previously added and exists in the {@link Map} object.

    Parameters

    • key: string

      The key of the element to add to the proxy object.

    Returns this

    The modified {@link ProxyCache}.

some

  • some(fn: (value: Role, key: string, map: this) => boolean, thisArg?: any): boolean
  • Tests if some entries in this cache meets a condition

    Parameters

    • fn: (value: Role, key: string, map: this) => boolean

      The function to test the condition

        • (value: Role, key: string, map: this): boolean
        • Parameters

          • value: Role
          • key: string
          • map: this

          Returns boolean

    • Optional thisArg: any

      Optional binding for the fn param

    Returns boolean

sort

  • sort(compareFunction?: undefined | ((v0: Role, v1: Role, k0?: K, k1?: K) => number)): this
  • Sorts entries in-place in this Cache

    Parameters

    • Optional compareFunction: undefined | ((v0: Role, v1: Role, k0?: K, k1?: K) => number)

      Function to determine how this Cache should be sorted

    Returns this

sorted

  • sorted(compareFunction?: undefined | ((v0: Role, v1: Role, k0?: K, k1?: K) => number)): Cache<string, Role>
  • Sorts entries in a new Cache

    Parameters

    • Optional compareFunction: undefined | ((v0: Role, v1: Role, k0?: K, k1?: K) => number)

      Function to determine how the resulting Cache should be sorted

    Returns Cache<string, Role>

sweep

  • sweep(fn: (value: Role, key: string, map: this) => boolean, thisArg?: any): number
  • Sweeps entries from this Cache

    Parameters

    • fn: (value: Role, key: string, map: this) => boolean

      Function used to determine what entries are swept

        • (value: Role, key: string, map: this): boolean
        • Parameters

          • value: Role
          • key: string
          • map: this

          Returns boolean

    • Optional thisArg: any

      Optional binding for the fn param

    Returns number

toJSON

  • toJSON(): string[]

values

  • values(): IterableIterator<Role>
  • Returns a new Iterator object that contains the values for each element in the {@link Map} object contained in the proxy in insertion order

    Returns IterableIterator<Role>

Generated using TypeDoc