Skip to content

@mastondzn/dank-twitch-irc / ChatClient

Class: ChatClient

Extends

Constructors

new ChatClient(configuration)

new ChatClient(configuration?): ChatClient

Parameters

configuration?: ClientConfiguration

Returns

ChatClient

Overrides

BaseClient.constructor

Source

src/client/client.ts:49

Properties

activeWhisperConn

private activeWhisperConn: undefined | SingleConnection

Source

src/client/client.ts:47


configuration

readonly configuration: ExpandedClientConfiguration

Inherited from

BaseClient.configuration

Source

src/client/base-client.ts:32


connectionMixins

readonly connectionMixins: ConnectionMixin[] = []

Source

src/client/client.ts:44


connectionPool?

optional connectionPool: ConnectionPool

Source

src/client/client.ts:43


connections

readonly connections: SingleConnection[] = []

Source

src/client/client.ts:46


roomStateTracker?

optional roomStateTracker: RoomStateTracker

Source

src/client/client.ts:41


state

state: ClientState = ClientState.UNCONNECTED

Inherited from

BaseClient.state

Source

src/client/base-client.ts:36


userStateTracker?

optional userStateTracker: UserStateTracker

Source

src/client/client.ts:42


prefixed

static prefixed: string | boolean

Inherited from

BaseClient.prefixed

Source

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

Accessors

closed

get closed(): boolean

Returns

boolean

Source

src/client/base-client.ts:28


connected

get connected(): boolean

Returns

boolean

Source

src/client/base-client.ts:20


connecting

get connecting(): boolean

Returns

boolean

Source

src/client/base-client.ts:16


joinedChannels

get joinedChannels(): Set<string>

Returns

Set<string>

Source

src/client/client.ts:37


ready

get ready(): boolean

Returns

boolean

Source

src/client/base-client.ts:24


unconnected

get unconnected(): boolean

Returns

boolean

Source

src/client/base-client.ts:12


wantedChannels

get wantedChannels(): Set<string>

Returns

Set<string>

Source

src/client/client.ts:33

Methods

addListener()

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

Type parameters

T extends string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents

Parameters

event: T

fn

context?: any

Returns

this

Inherited from

BaseClient.addListener

Source

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


advanceState()

advanceState(newState): boolean

Parameters

newState: ClientState

Returns

boolean

Inherited from

BaseClient.advanceState

Source

src/client/base-client.ts:80


close()

close(): void

Returns

void

Source

src/client/client.ts:85


connect()

connect(): Promise<void>

Returns

Promise<void>

Source

src/client/client.ts:78


destroy()

destroy(error?): void

Parameters

error?: Error

Returns

void

Source

src/client/client.ts:90


emit()

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

Calls each of the listeners registered for a given event.

Type parameters

T extends string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents

Parameters

event: T

• ...args: ArgumentMap<ClientEvents>[Extract<T, string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents>]

Returns

boolean

Inherited from

BaseClient.emit

Source

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


emitClosed()

emitClosed(error?): void

Parameters

error?: Error

Returns

void

Inherited from

BaseClient.emitClosed

Source

src/client/base-client.ts:74


emitConnected()

emitConnected(): void

Returns

void

Inherited from

BaseClient.emitConnected

Source

src/client/base-client.ts:62


emitConnecting()

emitConnecting(): void

Returns

void

Inherited from

BaseClient.emitConnecting

Source

src/client/base-client.ts:56


emitError()

emitError(error, emitEvenIfClosed): void

Parameters

error: Error

emitEvenIfClosed: boolean= false

Returns

void

Inherited from

BaseClient.emitError

Source

src/client/base-client.ts:43


emitMessage()

emitMessage(message): void

Parameters

message: IRCMessage

Returns

void

Inherited from

BaseClient.emitMessage

Source

src/client/base-client.ts:51


emitReady()

emitReady(): void

Returns

void

Inherited from

BaseClient.emitReady

Source

src/client/base-client.ts:68


eventNames()

eventNames(): (string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents)[]

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

Returns

(string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents)[]

Inherited from

BaseClient.eventNames

Source

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


join()

join(channelName): Promise<void>

Parameters

channelName: string

Returns

Promise<void>

Source

src/client/client.ts:111


joinAll()

joinAll(channelNames): Promise<Record<string, undefined | Error>>

Parameters

channelNames: string[]

Returns

Promise<Record<string, undefined | Error>>

Source

src/client/client.ts:141


listenerCount()

listenerCount(event): number

Return the number of listeners listening to a given event.

Parameters

event: string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents

Returns

number

Inherited from

BaseClient.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 string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents

Parameters

event: T

Returns

(...args) => void[]

Inherited from

BaseClient.listeners

Source

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


me()

me(channelName, message): Promise<void>

Parameters

channelName: string

message: string

Returns

Promise<void>

Source

src/client/client.ts:195


newConnection()

newConnection(): SingleConnection

Returns

SingleConnection

Source

src/client/client.ts:230


off()

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

Type parameters

T extends string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents

Parameters

event: T

fn?

context?: any

once?: boolean

Returns

this

Inherited from

BaseClient.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 string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents

Parameters

event: T

fn

context?: any

Returns

this

Inherited from

BaseClient.on

Source

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


once()

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

Add a one-time listener for a given event.

Type parameters

T extends string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents

Parameters

event: T

fn

context?: any

Returns

this

Inherited from

BaseClient.once

Source

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


part()

part(channelName): Promise<void>

Parameters

channelName: string

Returns

Promise<void>

Source

src/client/client.ts:126


ping()

ping(): Promise<void>

Returns

Promise<void>

Source

src/client/client.ts:226


privmsg()

privmsg(channelName, message): Promise<void>

Parameters

channelName: string

message: string

Returns

Promise<void>

Source

src/client/client.ts:179


reconnectFailedConnection()

private reconnectFailedConnection(conn): void

Parameters

conn: SingleConnection

Returns

void

Source

src/client/client.ts:291


removeAllListeners()

removeAllListeners(event?): this

Remove all listeners, or those of the specified event.

Parameters

event?: string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents

Returns

this

Inherited from

BaseClient.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 string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents

Parameters

event: T

fn?

context?: any

once?: boolean

Returns

this

Inherited from

BaseClient.removeListener

Source

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


reply()

reply(channelName, messageID, message): Promise<void>

Parameters

channelName: string

The channel name you want to reply in.

messageID: string

The message ID you want to reply to.

message: string

The message you want to send.

Returns

Promise<void>

Source

src/client/client.ts:210


requireConnection()

requireConnection(predicate): SingleConnection

Finds a connection from the list of connections that satisfies the given predicate, or if none was found, returns makes a new connection. This means that the given predicate must be specified in a way that a new connection always satisfies it.

Parameters

predicate: ConnectionPredicate= alwaysTrue

The predicate the connection must fulfill.

Returns

SingleConnection

Source

src/client/client.ts:312


say()

say(channelName, message): Promise<void>

Parameters

channelName: string

message: string

Returns

Promise<void>

Source

src/client/client.ts:185


sendRaw()

sendRaw(command): void

Sends a raw IRC command to the server, e.g. <code>JOIN #forsen</code>.

Throws an exception if the passed command contains one or more newline characters.

Parameters

command: string

Raw IRC command.

Returns

void

Source

src/client/client.ts:107


use()

use(mixin): void

Parameters

mixin: ClientMixin

Returns

void

Source

src/client/client.ts:287