Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ChatClient

Hierarchy

Index

Constructors

constructor

Properties

Readonly configuration

Readonly connectionMixins

connectionMixins: ConnectionMixin[] = []

Readonly connections

connections: SingleConnection[] = []

Optional roomStateTracker

roomStateTracker: RoomStateTracker

state

state: ClientState = ClientState.UNCONNECTED

Optional userStateTracker

userStateTracker: UserStateTracker

Static prefixed

prefixed: string | boolean

Accessors

closed

  • get closed(): boolean

connected

  • get connected(): boolean

connecting

  • get connecting(): boolean

joinedChannels

  • get joinedChannels(): Set<string>

ready

  • get ready(): boolean

unconnected

  • get unconnected(): boolean

wantedChannels

  • get wantedChannels(): Set<string>

Methods

addListener

  • addListener<T>(event: T, fn: EventEmitter.EventListener<ClientEvents, T>, context?: Context): this

advanceState

ban

  • ban(channelName: string, username: string, reason?: undefined | string): Promise<void>
  • Parameters

    • channelName: string
    • username: string
    • Optional reason: undefined | string

    Returns Promise<void>

close

  • close(): void

connect

  • connect(): Promise<void>

destroy

  • destroy(error?: Error): void

emit

  • emit<T>(event: T, ...args: EventEmitter.EventArgs<ClientEvents, T>): boolean
  • Calls each of the listeners registered for a given event.

    Type parameters

    Parameters

    • event: T
    • Rest ...args: EventEmitter.EventArgs<ClientEvents, T>

    Returns boolean

emitClosed

  • emitClosed(error?: Error): void

emitConnected

  • emitConnected(): void

emitConnecting

  • emitConnecting(): void

emitError

  • emitError(error: Error, emitEvenIfClosed?: boolean): void

emitMessage

emitReady

  • emitReady(): void

eventNames

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

    Returns Array<EventEmitter.EventNames<ClientEvents>>

getMods

  • getMods(channelName: string): Promise<string[]>

getVips

  • getVips(channelName: string): Promise<string[]>

join

  • join(channelName: string): Promise<void>

joinAll

  • joinAll(channelNames: string[]): Promise<Record<string, Error | undefined>>
  • Parameters

    • channelNames: string[]

    Returns Promise<Record<string, Error | undefined>>

listenerCount

  • listenerCount(event: EventEmitter.EventNames<ClientEvents>): number
  • Return the number of listeners listening to a given event.

    Parameters

    Returns number

listeners

  • Return the listeners registered for a given event.

    Type parameters

    Parameters

    • event: T

    Returns Array<EventEmitter.EventListener<ClientEvents, T>>

me

  • me(channelName: string, message: string): Promise<void>

newConnection

off

  • off<T>(event: T, fn?: EventEmitter.EventListener<ClientEvents, T>, context?: Context, once?: undefined | false | true): this
  • Type parameters

    Parameters

    • event: T
    • Optional fn: EventEmitter.EventListener<ClientEvents, T>
    • Optional context: Context
    • Optional once: undefined | false | true

    Returns this

on

  • Add a listener for a given event.

    Type parameters

    Parameters

    Returns this

once

  • Add a one-time listener for a given event.

    Type parameters

    Parameters

    Returns this

part

  • part(channelName: string): Promise<void>

ping

  • ping(): Promise<void>

privmsg

  • privmsg(channelName: string, message: string): Promise<void>

removeAllListeners

  • removeAllListeners(event?: EventEmitter.EventNames<ClientEvents>): this
  • Remove all listeners, or those of the specified event.

    Parameters

    Returns this

removeListener

  • removeListener<T>(event: T, fn?: EventEmitter.EventListener<ClientEvents, T>, context?: Context, once?: undefined | false | true): this
  • Remove the listeners of a given event.

    Type parameters

    Parameters

    • event: T
    • Optional fn: EventEmitter.EventListener<ClientEvents, T>
    • Optional context: Context
    • Optional once: undefined | false | true

    Returns this

say

  • say(channelName: string, message: string): Promise<void>

sendRaw

  • sendRaw(command: string): void
  • Sends a raw IRC command to the server, e.g. JOIN #forsen.

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

    Parameters

    • command: string

      Raw IRC command.

    Returns void

setColor

  • setColor(color: Color): Promise<void>

timeout

  • timeout(channelName: string, username: string, length: number, reason?: undefined | string): Promise<void>
  • Parameters

    • channelName: string
    • username: string
    • length: number
    • Optional reason: undefined | string

    Returns Promise<void>

use

whisper

  • whisper(username: string, message: string): Promise<void>

Generated using TypeDoc