Appearance
@mastondzn/dank-twitch-irc / ChatClient
Class: ChatClient
Extends
Constructors
new ChatClient(configuration)
new ChatClient(
configuration
?):ChatClient
Parameters
• configuration?: ClientConfiguration
Returns
Overrides
Source
Properties
activeWhisperConn
private
activeWhisperConn:undefined
|SingleConnection
Source
configuration
readonly
configuration:ExpandedClientConfiguration
Inherited from
Source
connectionMixins
readonly
connectionMixins:ConnectionMixin
[] =[]
Source
connectionPool?
optional
connectionPool:ConnectionPool
Source
connections
readonly
connections:SingleConnection
[] =[]
Source
roomStateTracker?
optional
roomStateTracker:RoomStateTracker
Source
state
state:
ClientState
=ClientState.UNCONNECTED
Inherited from
Source
userStateTracker?
optional
userStateTracker:UserStateTracker
Source
prefixed
static
prefixed:string
|boolean
Inherited from
Source
node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:9
Accessors
closed
get
closed():boolean
Returns
boolean
Source
connected
get
connected():boolean
Returns
boolean
Source
connecting
get
connecting():boolean
Returns
boolean
Source
joinedChannels
get
joinedChannels():Set
<string
>
Returns
Set
<string
>
Source
ready
get
ready():boolean
Returns
boolean
Source
unconnected
get
unconnected():boolean
Returns
boolean
Source
wantedChannels
get
wantedChannels():Set
<string
>
Returns
Set
<string
>
Source
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
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
Source
close()
close():
void
Returns
void
Source
connect()
connect():
Promise
<void
>
Returns
Promise
<void
>
Source
destroy()
destroy(
error
?):void
Parameters
• error?: Error
Returns
void
Source
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
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
Source
emitConnected()
emitConnected():
void
Returns
void
Inherited from
Source
emitConnecting()
emitConnecting():
void
Returns
void
Inherited from
Source
emitError()
emitError(
error
,emitEvenIfClosed
):void
Parameters
• error: Error
• emitEvenIfClosed: boolean
= false
Returns
void
Inherited from
Source
emitMessage()
emitMessage(
message
):void
Parameters
• message: IRCMessage
Returns
void
Inherited from
Source
emitReady()
emitReady():
void
Returns
void
Inherited from
Source
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
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
joinAll()
joinAll(
channelNames
):Promise
<Record
<string
,undefined
|Error
>>
Parameters
• channelNames: string
[]
Returns
Promise
<Record
<string
, undefined
| Error
>>
Source
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
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
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
newConnection()
newConnection():
SingleConnection
Returns
Source
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
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
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
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
ping()
ping():
Promise
<void
>
Returns
Promise
<void
>
Source
privmsg()
privmsg(
channelName
,message
):Promise
<void
>
Parameters
• channelName: string
• message: string
Returns
Promise
<void
>
Source
reconnectFailedConnection()
private
reconnectFailedConnection(conn
):void
Parameters
• conn: SingleConnection
Returns
void
Source
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
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
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
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
Source
say()
say(
channelName
,message
):Promise
<void
>
Parameters
• channelName: string
• message: string
Returns
Promise
<void
>
Source
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
use()
use(
mixin
):void
Parameters
• mixin: ClientMixin
Returns
void