Interface IIRCWrapper

Hierarchy

Implemented by

Properties

authenticated: boolean

Login success status.

channels: string[]

Channels the bot is currently in.

connected: boolean

Get connection status. authenticated is a more reliable indicator of a successful connection.

The connector to use for connecting to the IRC server.

options: IIRCOptions

Connection options for the IRC server.

queue: IQueue<any>[]

Current collectors waiting for their reply.

serverData: IIRCServerData

Information about the IRC server gathered during runtime

Methods

  • Create a new connection to the configured IRC server.

    Returns Promise<void>

  • Disconnect from the IRC server gracefully, sends QUIT.

    Parameters

    • Optional reason: string

      Reason for disconnection

    Returns Promise<void>

  • Parameters

    • event: string
    • Rest ...args: any[]

    Returns void

  • Asynchronously ping the server.

    Returns

    Ping in milliseconds

    Returns Promise<number>

  • Get a list of channels asynchronously

    Returns

    Channel list in [<channel>, <# visible>, <topic>][] format

    Returns Promise<string[][]>

  • Get a list of names in a channel asynchronously

    Returns

    String list of nicks (with mode prefixes preserved)

    Parameters

    • channel: string

      Channel to query

    Returns Promise<string[]>

  • Parameters

    • event: string
    • handler: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

  • Set a new nickname. A nick event will be fired for self. When setting the new nick fails, the connection will reset it and emit your previous nickname back in the nick event.

    Parameters

    • newNick: string

      New nickname

    Returns void

  • Add a collector to the queue. This is used to grab lines from the server, wait for them and return them in a callback.

    Parameters

    • collector: IQueue<any>

      IRC line collector

    • line: string

      Command to send to the server

    • Rest ...args: any[]

      Arguments to the command

    Returns void

  • Asynchronous WHO query on target

    Returns

    Parsed WHO response object array

    Parameters

    • target: string

      Channel or nick to query

    Returns Promise<WhoResponse[]>

  • Asynchronous WHOIS query on nick

    Returns

    Parsed WHOIS response object

    Parameters

    • nick: string

      Nick to query

    Returns Promise<WhoisResponse>

  • Send a raw command to the server.

    WARNING: Line break characters could have an unintended side-effect! Filter user-generated content!

    Parameters

    • format: string

      Command

    • Rest ...args: any[]

      Command arguments

    Returns void

Generated using TypeDoc