Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Client

Hierarchy

  • EventEmitter
    • Client

Implements

  • ClientInterface

Constructors

constructor

  • new Client(token: string, options?: ClientOptions): Client
  • Parameters

    • token: string
    • Optional options: ClientOptions

    Returns Client

Properties

chats

groups

groups: GroupManager

options

options: object = ...

Type declaration

  • fetchPartials: object
    • calendar: boolean
    • group: boolean
    • member: boolean
    • message: boolean
    • poll: boolean
    • user: boolean
  • websocket: boolean

relationships

relationships: RelationshipManager

rest

rest: default

token

token: string

user

user: default

users

ws

ws: default

Static Readonly captureRejectionSymbol

captureRejectionSymbol: typeof captureRejectionSymbol

Static captureRejections

captureRejections: boolean

Sets or gets the default captureRejection value for all emitters.

Static defaultMaxListeners

defaultMaxListeners: number

Static Readonly errorMonitor

errorMonitor: typeof errorMonitor

This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted, therefore the process will still crash if no regular 'error' listener is installed.

Methods

addListener

  • addListener(event: string | symbol, listener: function): Client
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

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

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

getMaxListeners

  • getMaxListeners(): number
  • Returns number

listenerCount

  • listenerCount(event: string | symbol): number
  • Parameters

    • event: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

login

  • Returns Promise<Client>

logout

  • logout(): Promise<void>
  • Returns Promise<void>

off

  • off(event: string | symbol, listener: function): Client
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

on

  • on(event: string | symbol, listener: function): Client
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

once

  • once(event: string | symbol, listener: function): Client
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

prependListener

  • prependListener(event: string | symbol, listener: function): Client
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): Client
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): Client
  • Parameters

    • Optional event: string | symbol

    Returns Client

removeListener

  • removeListener(event: string | symbol, listener: function): Client
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

setMaxListeners

  • setMaxListeners(n: number): Client
  • Parameters

    • n: number

    Returns Client

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Static on

  • on(emitter: EventEmitter, event: string): AsyncIterableIterator<any>
  • Parameters

    • emitter: EventEmitter
    • event: string

    Returns AsyncIterableIterator<any>

Static once

  • once(emitter: NodeEventTarget, event: string | symbol): Promise<any[]>
  • once(emitter: DOMEventTarget, event: string): Promise<any[]>
  • Parameters

    • emitter: NodeEventTarget
    • event: string | symbol

    Returns Promise<any[]>

  • Parameters

    • emitter: DOMEventTarget
    • event: string

    Returns Promise<any[]>

Generated using TypeDoc