Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShardClient

Shard Client, represents one gateway connection

Hierarchy

  • EventSpewer
    • ShardClient

Implements

  • EventEmitter

Index

Constructors

constructor

  • Parameters

    Returns ShardClient

Properties

_killed

_killed: boolean = false

application

application: Oauth2Application | null = null

applications

applications: Applications

channels

channels: Channels

cluster

cluster: ClusterClient | null = null

commandClient

commandClient: CommandClient | null = null

connectedAccounts

connectedAccounts: ConnectedAccounts

emojis

emojis: Emojis

gateway

gateway: Socket

detritus-client-socket's Gateway Socket

gatewayHandler

gatewayHandler: GatewayHandler

Our Dispatch Handler

guilds

guilds: Guilds

imageFormat

imageFormat: ImageFormats = ImageFormats.PNG

Default Image Format to use for any url getters

members

members: Members

messages

messages: Messages

notes

notes: Notes

owners

owners: BaseCollection<string, User> = new 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

presences

presences: Presences

ran

ran: boolean = false

If the client is ran or not

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

roles

roles: Roles

sessions

sessions: Sessions

token

token: string

our token

typings

user

user: null | UserMe = null

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

users

users: Users

voiceCalls

voiceCalls: VoiceCalls

voiceConnections

voiceConnections: VoiceConnections

voiceStates

voiceStates: VoiceStates

Accessors

clientId

  • get clientId(): string
  • Returns string

isBot

  • get isBot(): boolean
  • Returns boolean

killed

  • get killed(): boolean
  • Returns boolean

shardCount

  • get shardCount(): number
  • Returns number

shardId

  • get shardId(): number
  • Returns number

userId

  • get userId(): string
  • Returns string

Methods

_mergeOauth2Application

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

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>

getMaxListeners

  • getMaxListeners(): number
  • Returns number

hasEventListener

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

    • name: string | symbol

    Returns boolean

isOwner

  • isOwner(userId: string): boolean
  • Parameters

    • userId: string

    Returns boolean

kill

  • kill(error?: Error): void
  • Parameters

    Returns 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[]

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
  • on(event: "activityJoinInvite", listener: function): this
  • on(event: "activityJoinRequest", listener: function): this
  • on(event: "activityStart", listener: function): this
  • on(event: "braintreePopupBridgeCallback", listener: function): this
  • on(event: "callCreate", listener: function): this
  • on(event: "callDelete", listener: function): this
  • on(event: "callUpdate", listener: function): this
  • on(event: "channelCreate", listener: function): this
  • on(event: "channelDelete", listener: function): this
  • on(event: "channelPinsAck", listener: function): this
  • on(event: "channelPinsUpdate", listener: function): this
  • on(event: "channelUpdate", listener: function): this
  • on(event: "channelRecipientAdd", listener: function): this
  • on(event: "channelRecipientRemove", listener: function): this
  • on(event: "entitlementCreate", listener: function): this
  • on(event: "entitlementDelete", listener: function): this
  • on(event: "entitlementUpdate", listener: function): this
  • on(event: "friendSuggestionCreate", listener: function): this
  • on(event: "friendSuggestionDelete", listener: function): this
  • on(event: "gatewayReady", listener: function): this
  • on(event: "gatewayResumed", listener: function): this
  • on(event: "giftCodeUpdate", listener: function): this
  • on(event: "guildBanAdd", listener: function): this
  • on(event: "guildBanRemove", listener: function): this
  • on(event: "guildCreate", listener: function): this
  • on(event: "guildDelete", listener: function): this
  • on(event: "guildEmojisUpdate", listener: function): this
  • on(event: "guildIntegrationsUpdate", listener: function): this
  • on(event: "guildMemberAdd", listener: function): this
  • on(event: "guildMemberListUpdate", listener: function): this
  • on(event: "guildMemberRemove", listener: function): this
  • on(event: "guildMemberUpdate", listener: function): this
  • on(event: "guildMembersChunk", listener: function): this
  • on(event: "guildReady", listener: function): this
  • on(event: "guildRoleCreate", listener: function): this
  • on(event: "guildRoleDelete", listener: function): this
  • on(event: "guildRoleUpdate", listener: function): this
  • on(event: "guildUpdate", listener: function): this
  • on(event: "inviteCreate", listener: function): this
  • on(event: "inviteDelete", listener: function): this
  • on(event: "libraryApplicationUpdate", listener: function): this
  • on(event: "lobbyCreate", listener: function): this
  • on(event: "lobbyDelete", listener: function): this
  • on(event: "lobbyUpdate", listener: function): this
  • on(event: "lobbyMemberDisconnect", listener: function): this
  • on(event: "lobbyMemberUpdate", listener: function): this
  • on(event: "lobbyMessage", listener: function): this
  • on(event: "lobbyVoiceServerUpdate", listener: function): this
  • on(event: "lobbyVoiceStateUpdate", listener: function): this
  • on(event: "messageAck", listener: function): this
  • on(event: "messageCreate", listener: function): this
  • on(event: "messageDelete", listener: function): this
  • on(event: "messageDeleteBulk", listener: function): this
  • on(event: "messageReactionAdd", listener: function): this
  • on(event: "messageReactionRemove", listener: function): this
  • on(event: "messageReactionRemoveAll", listener: function): this
  • on(event: "messageReactionRemoveEmoji", listener: function): this
  • on(event: "messageUpdate", listener: function): this
  • on(event: "oauth2TokenRevoke", listener: function): this
  • on(event: "presenceUpdate", listener: function): this
  • on(event: "presencesReplace", listener: function): this
  • on(event: "recentMentionDelete", listener: function): this
  • on(event: "relationshipAdd", listener: function): this
  • on(event: "relationshipRemove", listener: function): this
  • on(event: "sessionsReplace", listener: function): this
  • on(event: "streamCreate", listener: function): this
  • on(event: "streamDelete", listener: function): this
  • on(event: "streamServerUpdate", listener: function): this
  • on(event: "streamUpdate", listener: function): this
  • on(event: "typingStart", listener: function): this
  • on(event: "typingStop", listener: function): this
  • on(event: "userAchievementUpdate", listener: function): this
  • on(event: "userConnectionsUpdate", listener: function): this
  • on(event: "userFeedSettingsUpdate", listener: function): this
  • on(event: "userGuildSettingsUpdate", listener: function): this
  • on(event: "userNoteUpdate", listener: function): this
  • on(event: "userPaymentSourcesUpdate", listener: function): this
  • on(event: "userPaymentsUpdate", listener: function): this
  • on(event: "userUpdate", listener: function): this
  • on(event: "usersUpdate", listener: function): this
  • on(event: "voiceServerUpdate", listener: function): this
  • on(event: "voiceStateUpdate", listener: function): this
  • on(event: "webhooksUpdate", listener: function): this
  • on(event: "raw", listener: function): this
  • on(event: "restRequest", listener: function): this
  • on(event: "restResponse", listener: function): this
  • on(event: "unknown", listener: function): this
  • on(event: "warn", listener: function): this
  • on(event: "killed", listener: function): this
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • event: "callCreate"
    • listener: function

    Returns this

  • Parameters

    • event: "callDelete"
    • listener: function

    Returns this

  • Parameters

    • event: "callUpdate"
    • listener: function

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • event: "guildBanAdd"
    • listener: function

    Returns this

  • Parameters

    Returns this

  • Parameters

    • event: "guildCreate"
    • listener: function

    Returns this

  • Parameters

    • event: "guildDelete"
    • listener: function

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • event: "guildReady"
    • listener: function

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • event: "guildUpdate"
    • listener: function

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • event: "lobbyCreate"
    • listener: function

    Returns this

  • Parameters

    • event: "lobbyDelete"
    • listener: function

    Returns this

  • Parameters

    • event: "lobbyUpdate"
    • listener: function

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • event: "messageAck"
    • listener: function

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • event: "typingStart"
    • listener: function

    Returns this

  • Parameters

    • event: "typingStop"
    • listener: function

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • event: "userUpdate"
    • listener: function

    Returns this

  • Parameters

    • event: "usersUpdate"
    • listener: function

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • event: "raw"
    • listener: function
        • (payload: Raw): any
        • Parameters

          Returns any

    Returns this

  • Parameters

    • event: "restRequest"
    • listener: function

    Returns this

  • Parameters

    Returns this

  • Parameters

    • event: "unknown"
    • listener: function

    Returns this

  • Parameters

    • event: "warn"
    • listener: function
        • (payload: Warn): any
        • Parameters

          Returns any

    Returns this

  • Parameters

    • event: "killed"
    • listener: function
        • Parameters

          Returns any

    Returns this

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

ping

  • ping(): Promise<object>
  • Returns Promise<object>

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[]

removeAllListeners

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

    • Optional name: string | symbol

    Returns this

removeAllSubscriptions

  • removeAllSubscriptions(): this
  • 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

removeSubscription

  • removeSubscription(subscription: EventSubscription): void
  • Parameters

    • subscription: EventSubscription

    Returns void

requestGuildMembers

  • requestGuildMembers(guildId: string, oldOptions: object): Promise<object>
  • Parameters

    • guildId: string
    • oldOptions: object
      • Optional limit?: undefined | number
      • Optional presences?: undefined | false | true
      • query: string
      • Optional timeout?: undefined | number
      • Optional userIds?: Array<string>

    Returns Promise<object>

reset

  • reset(): void
  • Returns void

run

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

subscribe

  • subscribe(name: string | symbol, listener: function): EventSubscription
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns EventSubscription

toString

  • toString(): string
  • Returns string

voiceConnect

  • voiceConnect(guildId?: null | string, channelId?: null | string, options?: VoiceConnectOptions): Promise<object | null>
  • 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

    • Default value options: VoiceConnectOptions = {}

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

    Returns Promise<object | null>

    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

Generated using TypeDoc