Skip to content

@mastondzn/dank-twitch-irc / UserStateTracker

Class: UserStateTracker

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

Extends

Implements

Constructors

new UserStateTracker(client)

new UserStateTracker(client): UserStateTracker

Parameters

client: ChatClient

Returns

UserStateTracker

Overrides

EventEmitter<UserStateTrackerEvents>.constructor

Source

src/mixins/userstate-tracker.ts:31

Properties

channelStates

channelStates: Record<string, UserState> = {}

Source

src/mixins/userstate-tracker.ts:28


client

private readonly client: ChatClient

Source

src/mixins/userstate-tracker.ts:29


globalState?

optional globalState: GlobalUserState

Source

src/mixins/userstate-tracker.ts:27


prefixed

static prefixed: string | boolean

Inherited from

EventEmitter.prefixed

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:9

Methods

addListener()

addListener<T>(event, fn, context?): this

Type parameters

T extends keyof UserStateTrackerEvents

Parameters

event: T

fn

context?: any

Returns

this

Inherited from

EventEmitter.addListener

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:45


applyToClient()

applyToClient(client): void

Parameters

client: ChatClient

Returns

void

Implementation of

ClientMixin.applyToClient

Source

src/mixins/userstate-tracker.ts:44


emit()

emit<T>(event, ...args): boolean

Calls each of the listeners registered for a given event.

Type parameters

T extends keyof UserStateTrackerEvents

Parameters

event: T

• ...args: ArgumentMap<UserStateTrackerEvents>[Extract<T, keyof UserStateTrackerEvents>]

Returns

boolean

Inherited from

EventEmitter.emit

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:32


eventNames()

eventNames(): keyof UserStateTrackerEvents[]

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

Returns

keyof UserStateTrackerEvents[]

Inherited from

EventEmitter.eventNames

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:15


getChannelState()

getChannelState(channelName): undefined | UserState

Parameters

channelName: string

Returns

undefined | UserState

Source

src/mixins/userstate-tracker.ts:36


getGlobalState()

getGlobalState(): undefined | GlobalUserState

Returns

undefined | GlobalUserState

Source

src/mixins/userstate-tracker.ts:40


listenerCount()

listenerCount(event): number

Return the number of listeners listening to a given event.

Parameters

event: keyof UserStateTrackerEvents

Returns

number

Inherited from

EventEmitter.listenerCount

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:27


listeners()

listeners<T>(event): (...args) => void[]

Return the listeners registered for a given event.

Type parameters

T extends keyof UserStateTrackerEvents

Parameters

event: T

Returns

(...args) => void[]

Inherited from

EventEmitter.listeners

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:20


off()

off<T>(event, fn?, context?, once?): this

Type parameters

T extends keyof UserStateTrackerEvents

Parameters

event: T

fn?

context?: any

once?: boolean

Returns

this

Inherited from

EventEmitter.off

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:69


on()

on<T>(event, fn, context?): this

Add a listener for a given event.

Type parameters

T extends keyof UserStateTrackerEvents

Parameters

event: T

fn

context?: any

Returns

this

Inherited from

EventEmitter.on

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:40


onGlobaluserstateMessage()

private onGlobaluserstateMessage(message): void

Parameters

message: GlobaluserstateMessage

Returns

void

Source

src/mixins/userstate-tracker.ts:57


onPrivmsgMessage()

private onPrivmsgMessage(message): void

Parameters

message: PrivmsgMessage

Returns

void

Source

src/mixins/userstate-tracker.ts:62


onUserstateMessage()

private onUserstateMessage(message): void

Parameters

message: UserstateMessage

Returns

void

Source

src/mixins/userstate-tracker.ts:51


once()

once<T>(event, fn, context?): this

Add a one-time listener for a given event.

Type parameters

T extends keyof UserStateTrackerEvents

Parameters

event: T

fn

context?: any

Returns

this

Inherited from

EventEmitter.once

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:54


removeAllListeners()

removeAllListeners(event?): this

Remove all listeners, or those of the specified event.

Parameters

event?: keyof UserStateTrackerEvents

Returns

this

Inherited from

EventEmitter.removeAllListeners

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:79


removeListener()

removeListener<T>(event, fn?, context?, once?): this

Remove the listeners of a given event.

Type parameters

T extends keyof UserStateTrackerEvents

Parameters

event: T

fn?

context?: any

once?: boolean

Returns

this

Inherited from

EventEmitter.removeListener

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:63