Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Client

Hierarchy

  • EventEmitter
    • Client

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Client(host: string, group: string, options: any): Client

Properties

_connAttempts

_connAttempts: number

_connecting

_connecting: boolean

_lastPong

_lastPong: number

_messageID

_messageID: number

_pending

_pending: any

_pingInterval

_pingInterval: any

_pongTimeout

_pongTimeout: Timeout

_reconnecting

_reconnecting: boolean

additionalHeaders

additionalHeaders: object

authenticated

authenticated: boolean

autoReconnect

autoReconnect: any

channels

channels: any

connected

connected: boolean

email

email: string

getAllUsers

getAllUsers: function

Type declaration

    • (): any
    • Returns any

group

group: string

hasAccessToken

hasAccessToken: boolean

host

host: string

httpProxy

httpProxy: any

logger

logger: any

me

me: any

messageMaxRunes

messageMaxRunes: number

mfaToken

mfaToken: string

options

options: any

password

password: string

preferences

preferences: any

self

self: any

socketUrl

socketUrl: string

teamID

teamID: any

teams

teams: any

tlsverify

tlsverify: boolean

token

token: any

useTLS

useTLS: boolean

users

users: any

ws

ws: any

Static defaultMaxListeners

defaultMaxListeners: number

Methods

_apiCall

  • _apiCall(method: string, path: string, params: any, callback: any, callbackParams?: any, isForm?: boolean): Request
  • Parameters

    • method: string
    • path: string
    • params: any
    • callback: any
    • Default value callbackParams: any = {}
    • Default value isForm: boolean = false

    Returns Request

_chunkMessage

  • _chunkMessage(msg: any): Array<string>

_getApiUrl

  • _getApiUrl(path: string): string

_getSocketUrl

  • _getSocketUrl(): string

_onAddUserToTeam

  • _onAddUserToTeam(data: any): boolean

_onChannelLastViewed

  • _onChannelLastViewed(data: any, _headers: any, _params: any): boolean
  • Parameters

    • data: any
    • _headers: any
    • _params: any

    Returns boolean

_onChannels

  • _onChannels(data: any, _headers: any, _params: any): boolean
  • Parameters

    • data: any
    • _headers: any
    • _params: any

    Returns boolean

_onCheckIfTeamExists

  • _onCheckIfTeamExists(data: any): boolean

_onCreateTeam

  • _onCreateTeam(data: any): boolean

_onCreateUser

  • _onCreateUser(data: any): boolean

_onLoadUser

  • _onLoadUser(data: any, _headers: any, _params: any): boolean
  • Parameters

    • data: any
    • _headers: any
    • _params: any

    Returns boolean

_onLoadUsers

  • _onLoadUsers(data: User[] | any, _headers: any, params: any): any

_onLogin

  • _onLogin(data: any, headers: any): false | Timeout | Request
  • Parameters

    • data: any
    • headers: any

    Returns false | Timeout | Request

_onMe

  • _onMe(data: any, _headers: any, _params: any): any
  • Parameters

    • data: any
    • _headers: any
    • _params: any

    Returns any

_onMembersFromChannels

  • _onMembersFromChannels(data: any, _headers: any, _params: any): boolean
  • Parameters

    • data: any
    • _headers: any
    • _params: any

    Returns boolean

_onMessages

  • _onMessages(data: any, _headers: any, _params: any): boolean
  • Parameters

    • data: any
    • _headers: any
    • _params: any

    Returns boolean

_onPreferences

  • _onPreferences(data: any, _headers: any, _params: any): any
  • Parameters

    • data: any
    • _headers: any
    • _params: any

    Returns any

_onRevoke

  • _onRevoke(data: any): boolean

_onTeams

  • _onTeams(data: any, _headers: any, _params: any): any
  • Parameters

    • data: any
    • _headers: any
    • _params: any

    Returns any

_onTeamsByName

  • _onTeamsByName(data: any, _headers: any, _params: any): boolean
  • Parameters

    • data: any
    • _headers: any
    • _params: any

    Returns boolean

_onUnreadsForChannels

  • _onUnreadsForChannels(data: any, _headers: any, _params: any): boolean
  • Parameters

    • data: any
    • _headers: any
    • _params: any

    Returns boolean

_onUsersOfChannel

  • _onUsersOfChannel(data: any, _headers: any, _params: any): boolean
  • Parameters

    • data: any
    • _headers: any
    • _params: any

    Returns boolean

_send

  • _send(message: any): any

addListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns this

addUserToChannel

  • addUserToChannel(privateChannel: any, callback: any): Request
  • Parameters

    • privateChannel: any
    • callback: any

    Returns Request

addUserToTeam

  • addUserToTeam(user_id: string, team_id: string): Request
  • Parameters

    • user_id: string
    • team_id: string

    Returns Request

channelRoute

  • channelRoute(channelId: string): string

checkIfTeamExists

  • checkIfTeamExists(teamName: string): Request

connect

  • connect(): void

createDirectChannel

  • createDirectChannel(userID: string, callback: any): Request
  • Parameters

    • userID: string
    • callback: any

    Returns Request

createGroupChannel

  • createGroupChannel(userIDs: string, callback: any): Request
  • Parameters

    • userIDs: string
    • callback: any

    Returns Request

createPrivateChannel

  • createPrivateChannel(privateChannel: any, callback: any): Request
  • Parameters

    • privateChannel: any
    • callback: any

    Returns Request

createTeam

  • createTeam(name: string, display_name: string, type?: string): Request
  • Parameters

    • name: string
    • display_name: string
    • Default value type: string = "I"

    Returns Request

createUser

  • createUser(user: User): Request

customMessage

  • customMessage(postData: any, channelID: string): Request
  • Parameters

    • postData: any
    • channelID: string

    Returns Request

dialog

  • dialog(triggerId: string, url: string, dialog: any): Request
  • Parameters

    • triggerId: string
    • url: string
    • dialog: any

    Returns Request

disconnect

  • disconnect(): boolean

editPost

  • editPost(postId: string, msg: any): Request

emit

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

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

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

findChannelByName

  • findChannelByName(name: string): string | null

getAllChannels

  • getAllChannels(): Record<string, any>

getChannelByID

  • getChannelByID(id: string): Record<string, any>

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getMe

  • getMe(): Request

getPreferences

  • getPreferences(): Request

getTeamByName

  • getTeamByName(teamName: string): Request

getTeams

  • getTeams(): Request

getUserByEmail

  • getUserByEmail(email: string): Record<string, any>

getUserByID

  • getUserByID(id: string): Record<string, any>

getUserDirectMessageChannel

  • getUserDirectMessageChannel(userID: string, callback: any): void

listenerCount

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

    • type: string | symbol

    Returns number

listeners

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

    • event: string | symbol

    Returns Function[]

loadChannelLastViewed

  • loadChannelLastViewed(channelId: string, prevChannelId?: string | null): Request
  • Parameters

    • channelId: string
    • Default value prevChannelId: string | null = null

    Returns Request

loadChannels

  • loadChannels(): Request

loadMembersFromChannels

  • loadMembersFromChannels(): Request

loadMessagesFromChannel

  • loadMessagesFromChannel(channelId: string, options?: any): Request
  • Parameters

    • channelId: string
    • Default value options: any = {}

    Returns Request

loadUnreadsForChannels

  • loadUnreadsForChannels(): Request

loadUser

  • loadUser(userId: string): Request

loadUsers

  • loadUsers(page?: number, byTeam?: boolean): Request
  • Parameters

    • Default value page: number = 0
    • Default value byTeam: boolean = true

    Returns Request

loadUsersFromChannel

  • loadUsersFromChannel(channelId: string): Request

login

  • login(email: string, password: string, mfaToken: string): Request
  • Parameters

    • email: string
    • password: string
    • mfaToken: string

    Returns Request

off

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

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

          • Rest ...args: any[]

          Returns void

    Returns this

on

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

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

          • Rest ...args: any[]

          Returns void

    Returns this

onMessage

  • onMessage(message: any): any

once

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

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

          • Rest ...args: any[]

          Returns void

    Returns this

postMessage

  • postMessage(msg: any, channelID: string): Request

prependListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns this

rawListeners

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

    • event: string | symbol

    Returns Function[]

react

  • react(messageID: string, emoji: string): Request
  • Parameters

    • messageID: string
    • emoji: string

    Returns Request

reconnect

  • reconnect(): false | Timeout

removeAllListeners

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

    • Optional event: string | symbol

    Returns this

removeListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns this

revoke

  • revoke(userID: string): Request

setChannelHeader

  • setChannelHeader(channelID: string, header: any): Request
  • Parameters

    • channelID: string
    • header: any

    Returns Request

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

teamRoute

  • teamRoute(): string

tokenLogin

  • tokenLogin(token: string): Request

unreact

  • unreact(messageID: string, emoji: string): Request
  • Parameters

    • messageID: string
    • emoji: string

    Returns Request

uploadFile

  • uploadFile(channelId: string, file: any, callback: any): Request
  • Parameters

    • channelId: string
    • file: any
    • callback: any

    Returns Request

Static listenerCount

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

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc