Appearance
@mastondzn/dank-twitch-irc / RoomStateTracker
Class: RoomStateTracker
Tracks the state of the logged in user (the bot) in all channels the bot operates in
Extends
EventEmitter
<RoomStateTrackerEvents
>
Implements
Constructors
new RoomStateTracker()
new RoomStateTracker():
RoomStateTracker
Returns
Inherited from
EventEmitter<RoomStateTrackerEvents>.constructor
Properties
channelStates
private
readonly
channelStates:Record
<string
,RoomState
> ={}
Source
src/mixins/roomstate-tracker.ts:25
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 "newChannelState"
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
Source
src/mixins/roomstate-tracker.ts:31
emit()
emit<
T
>(event
, ...args
):boolean
Calls each of the listeners registered for a given event.
Type parameters
• T extends "newChannelState"
Parameters
• event: T
• ...args: ArgumentMap
<RoomStateTrackerEvents
>[Extract
<T
, "newChannelState"
>]
Returns
boolean
Inherited from
EventEmitter.emit
Source
node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:32
eventNames()
eventNames():
"newChannelState"
[]
Return an array listing the events for which the emitter has registered listeners.
Returns
"newChannelState"
[]
Inherited from
EventEmitter.eventNames
Source
node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:15
getChannelState()
getChannelState(
channelName
):undefined
|RoomState
Parameters
• channelName: string
Returns
undefined
| RoomState
Source
src/mixins/roomstate-tracker.ts:27
listenerCount()
listenerCount(
event
):number
Return the number of listeners listening to a given event.
Parameters
• event: "newChannelState"
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 "newChannelState"
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 "newChannelState"
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 "newChannelState"
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
onRoomstateMessage()
private
onRoomstateMessage(message
):void
Parameters
• message: RoomstateMessage
Returns
void
Source
src/mixins/roomstate-tracker.ts:36
once()
once<
T
>(event
,fn
,context
?):this
Add a one-time listener for a given event.
Type parameters
• T extends "newChannelState"
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?: "newChannelState"
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 "newChannelState"
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