Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

Properties

connectionMixins: ConnectionMixin[] = []
connectionPool?: ConnectionPool
connections: SingleConnection[] = []
roomStateTracker?: RoomStateTracker
state: ClientState = ClientState.UNCONNECTED
userStateTracker?: UserStateTracker

Accessors

  • get closed(): boolean
  • get connected(): boolean
  • get connecting(): boolean
  • get joinedChannels(): Set<string>
  • get ready(): boolean
  • get unconnected(): boolean
  • get wantedChannels(): Set<string>

Methods

  • addListener<T>(event: T, fn: (...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>]) => void, context?: any): ChatClient
  • Type parameters

    • T: (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: (...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>]) => void
        • (...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>]): void
        • Parameters

          • Rest ...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 void

    • Optional context: any

    Returns ChatClient

  • close(): void
  • connect(): Promise<void>
  • destroy(error?: Error): void
  • emit<T>(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>]): boolean
  • Calls each of the listeners registered for a given event.

    Type parameters

    • T: (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
    • Rest ...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

  • emitClosed(error?: Error): void
  • emitConnected(): void
  • emitConnecting(): void
  • emitError(error: Error, emitEvenIfClosed?: boolean): void
  • emitReady(): void
  • 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)[]

  • join(channelName: string): Promise<void>
  • joinAll(channelNames: string[]): Promise<Record<string, undefined | Error>>
  • listenerCount(event: (string & Record<never, never>) | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents): 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

  • listeners<T>(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>]) => void)[]
  • Return the listeners registered for a given event.

    Type parameters

    • T: (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: 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>]) => void)[]

  • me(channelName: string, message: string): Promise<void>
  • off<T>(event: T, fn?: (...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>]) => void, context?: any, once?: boolean): ChatClient
  • Type parameters

    • T: (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
    • Optional fn: (...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>]) => void
        • (...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>]): void
        • Parameters

          • Rest ...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 void

    • Optional context: any
    • Optional once: boolean

    Returns ChatClient

  • on<T>(event: T, fn: (...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>]) => void, context?: any): ChatClient
  • Add a listener for a given event.

    Type parameters

    • T: (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: (...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>]) => void
        • (...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>]): void
        • Parameters

          • Rest ...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 void

    • Optional context: any

    Returns ChatClient

  • once<T>(event: T, fn: (...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>]) => void, context?: any): ChatClient
  • Add a one-time listener for a given event.

    Type parameters

    • T: (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: (...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>]) => void
        • (...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>]): void
        • Parameters

          • Rest ...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 void

    • Optional context: any

    Returns ChatClient

  • part(channelName: string): Promise<void>
  • ping(): Promise<void>
  • privmsg(channelName: string, message: string): Promise<void>
  • removeAllListeners(event?: (string & Record<never, never>) | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents): ChatClient
  • Remove all listeners, or those of the specified event.

    Parameters

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

    Returns ChatClient

  • removeListener<T>(event: T, fn?: (...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>]) => void, context?: any, once?: boolean): ChatClient
  • Remove the listeners of a given event.

    Type parameters

    • T: (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
    • Optional fn: (...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>]) => void
        • (...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>]): void
        • Parameters

          • Rest ...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 void

    • Optional context: any
    • Optional once: boolean

    Returns ChatClient

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

    • channelName: string
    • messageID: string

      The message ID you want to reply to.

    • message: string

    Returns Promise<void>

  • 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

    Returns SingleConnection

  • say(channelName: string, message: string): Promise<void>
  • 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

Generated using TypeDoc