Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UserStateTracker

Tracks the state of the logged in user (the bot) in all channels the bot operates in

Hierarchy

Implements

Index

Type aliases

Static ArgumentMap

ArgumentMap<T>: {}

Type parameters

  • T: object

Type declaration

Static EventArgs

EventArgs<T, K>: Parameters<EventListener<T, K>>

Type parameters

Static EventListener

EventListener<T, K>: T extends string | symbol ? (...args: any[]) => void : (...args: ArgumentMap<Exclude<T, string | symbol>>[Extract<K, keyof T>]) => void

Type parameters

Static EventNames

EventNames<T>: T extends string | symbol ? T : keyof T

Type parameters

Static ValidEventTypes

ValidEventTypes: string | symbol | object

object should be in either of the following forms:

interface EventTypes {
  'event-with-parameters': any[]
  'event-with-example-handler': (...args: any[]) => void
}

Constructors

constructor

Properties

channelStates

channelStates: Record<string, UserState>

Optional globalState

globalState: GlobalUserState

Static EventEmitter

EventEmitter: EventEmitterStatic

Static prefixed

prefixed: string | boolean

Methods

addListener

applyToClient

emit

  • Calls each of the listeners registered for a given event.

    Type parameters

    Parameters

    Returns boolean

eventNames

  • Return an array listing the events for which the emitter has registered listeners.

    Returns Array<EventEmitter.EventNames<UserStateTrackerEvents>>

getChannelState

  • getChannelState(channelName: string): UserState | undefined

getGlobalState

listenerCount

  • Return the number of listeners listening to a given event.

    Parameters

    Returns number

listeners

off

on

once

removeAllListeners

removeListener

  • removeListener<T>(event: T, fn?: EventEmitter.EventListener<UserStateTrackerEvents, T>, context?: Context, once?: undefined | false | true): this

Generated using TypeDoc