Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShardClient

Shard Client, represents one gateway connection

Hierarchy

  • EventSpewer
    • ShardClient

Index

Constructors

constructor

Properties

_killed

_killed: boolean = false

application

application: null | Oauth2Application = null

Readonly applications

applications: Applications

Readonly channels

channels: Channels

cluster

cluster: null | ClusterClient = null

commandClient

commandClient: null | CommandClient = null

Readonly connectedAccounts

connectedAccounts: ConnectedAccounts

Readonly emojis

emojis: Emojis

gateway

gateway: Socket

detritus-client-socket's Gateway Socket

gatewayHandler

gatewayHandler: GatewayHandler

Our Dispatch Handler

Readonly guilds

guilds: Guilds

imageFormat

imageFormat: ImageFormats = ...

Default Image Format to use for any url getters

interactionCommandClient

interactionCommandClient: null | InteractionCommandClient = null

Readonly interactions

interactions: Interactions

Readonly members

members: Members

Readonly messages

messages: Messages

Readonly notes

notes: Notes

owners

owners: BaseCollection<string, User> = ...

If this is a bot, this will be filled with it's application owner or all of the application's team owners If this is a user, this will only include the user object Only fills once we receive the Ready payload

Readonly presences

presences: Presences

ran

ran: boolean = false

If the client is ran or not

Readonly relationships

relationships: Relationships

Optional requiredAction

requiredAction: null | string

(Users only) if the client requires an action (like the captcha overlay)

rest

detritus-client-rest's Rest Client, but wrapped over

Readonly roles

roles: Roles

Readonly sessions

sessions: Sessions

Readonly stageInstances

stageInstances: StageInstances

Readonly stickers

stickers: Stickers

token

token: string

our token

Readonly typings

user

user: null | UserMe = null

Us, only fills once we received the Ready payload from the gateway

Readonly users

users: Users

Readonly voiceCalls

voiceCalls: VoiceCalls

Readonly voiceConnections

voiceConnections: VoiceConnections

Readonly voiceStates

voiceStates: VoiceStates

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.

Accessors

applicationId

  • get applicationId(): string

clientId

  • get clientId(): string

isBot

  • get isBot(): boolean

killed

  • get killed(): boolean

shardCount

  • get shardCount(): number

shardId

  • get shardId(): number

userId

  • get userId(): string

Methods

_mergeOauth2Application

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): ShardClient
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns ShardClient

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

hasEventListener

  • hasEventListener(name: string | symbol): boolean
  • Parameters

    • name: string | symbol

    Returns boolean

hookComponents

isOwner

  • isOwner(userId: string): boolean

kill

  • kill(error?: Error): void

listenerCount

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

    • event: string | symbol

    Returns number

listeners

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

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: (...args: any[]) => void): ShardClient
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns ShardClient

on

once

ping

  • ping(): Promise<{ gateway: number; rest: number }>

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): ShardClient
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns ShardClient

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): ShardClient
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns ShardClient

rawListeners

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

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(name?: string | symbol): ShardClient
  • Parameters

    • Optional name: string | symbol

    Returns ShardClient

removeAllSubscriptions

  • Returns ShardClient

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): ShardClient
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns ShardClient

removeSubscription

  • removeSubscription(subscription: EventSubscription): void
  • Parameters

    • subscription: EventSubscription

    Returns void

requestGuildMembers

  • requestGuildMembers(guildId: string, oldOptions: { limit?: number; presences?: boolean; query: string; timeout?: number; userIds?: string[] }): Promise<{ members: BaseCollection<string, Member>; nonce: string; notFound: BaseSet<string>; presences: BaseCollection<string, Presence> }>
  • Parameters

    • guildId: string
    • oldOptions: { limit?: number; presences?: boolean; query: string; timeout?: number; userIds?: string[] }
      • Optional limit?: number
      • Optional presences?: boolean
      • query: string
      • Optional timeout?: number
      • Optional userIds?: string[]

    Returns Promise<{ members: BaseCollection<string, Member>; nonce: string; notFound: BaseSet<string>; presences: BaseCollection<string, Presence> }>

reset

  • reset(applications?: boolean): void

run

setMaxListeners

  • Parameters

    • n: number

    Returns ShardClient

subscribe

toString

  • toString(): string

voiceConnect

  • Parameters

    • Optional guildId: null | string

      Guild Id you want to connect to, if a user and wanting to connect to a Dm Channel, keep this blank

    • Optional channelId: null | string

      Channel Id you want to connect to or move to

    • options: VoiceConnectOptions = {}

      Options to pass into the detritus-client-socket's gateway's voiceConnect

    Returns Promise<null | VoiceConnectObject>

    Returns a promise that resolves into a Voice Connection object and an isNew variable. isNew is used to see if the connection was reused (e.g. changing channels) so you can put listeners on or not

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