Skip to main content

Class: SapphireClient<Ready>

Type parameters

NameType
Readyextends boolean = boolean

Hierarchy

  • Client<Ready>

    SapphireClient

Constructors

constructor

new SapphireClient<Ready>(options)

Type parameters

NameType
Readyextends boolean = boolean

Parameters

NameType
optionsClientOptions

Overrides

Client<Ready\>.constructor

Defined in

projects/framework/src/lib/SapphireClient.ts:264

Properties

application

application: If<Ready, ClientApplication, null>

Inherited from

Client.application

Defined in

node_modules/discord.js/typings/index.d.ts:899


channels

channels: ChannelManager

Inherited from

Client.channels

Defined in

node_modules/discord.js/typings/index.d.ts:900


disableMentionPrefix

Optional disableMentionPrefix: boolean

Defined in

projects/framework/src/lib/SapphireClient.ts:256


fetchPrefix

fetchPrefix: SapphirePrefixHook

Overrides

Client.fetchPrefix

Defined in

projects/framework/src/lib/SapphireClient.ts:239


guilds

guilds: GuildManager

Inherited from

Client.guilds

Defined in

node_modules/discord.js/typings/index.d.ts:902


id

id: null | string = null

Overrides

Client.id

Defined in

projects/framework/src/lib/SapphireClient.ts:209


logger

logger: ILogger

Overrides

Client.logger

Defined in

projects/framework/src/lib/SapphireClient.ts:246


options

options: Omit<ClientOptions, "intents"> & { intents: IntentsBitField }

Inherited from

Client.options

Defined in

node_modules/discord.js/typings/index.d.ts:903


readyTimestamp

readyTimestamp: If<Ready, number, null>

Inherited from

Client.readyTimestamp

Defined in

node_modules/discord.js/typings/index.d.ts:905


rest

rest: REST

Inherited from

Client.rest

Defined in

node_modules/discord.js/typings/index.d.ts:476


shard

shard: null | ShardClientUtil

Inherited from

Client.shard

Defined in

node_modules/discord.js/typings/index.d.ts:907


stores

stores: StoreRegistry

Overrides

Client.stores

Defined in

projects/framework/src/lib/SapphireClient.ts:262


sweepers

sweepers: Sweepers

Inherited from

Client.sweepers

Defined in

node_modules/discord.js/typings/index.d.ts:906


token

token: If<Ready, string, null | string>

Inherited from

Client.token

Defined in

node_modules/discord.js/typings/index.d.ts:908


user

user: If<Ready, ClientUser, null>

Inherited from

Client.user

Defined in

node_modules/discord.js/typings/index.d.ts:910


users

users: UserManager

Inherited from

Client.users

Defined in

node_modules/discord.js/typings/index.d.ts:911


voice

voice: ClientVoiceManager

Inherited from

Client.voice

Defined in

node_modules/discord.js/typings/index.d.ts:912


ws

ws: WebSocketManager

Inherited from

Client.ws

Defined in

node_modules/discord.js/typings/index.d.ts:913


captureRejectionSymbol

Static Readonly captureRejectionSymbol: typeof captureRejectionSymbol

Inherited from

Client.captureRejectionSymbol

Defined in

node_modules/@types/node/events.d.ts:328


captureRejections

Static captureRejections: boolean

Inherited from

Client.captureRejections

Defined in

node_modules/@types/node/events.d.ts:333


defaultMaxListeners

Static defaultMaxListeners: number

Inherited from

Client.defaultMaxListeners

Defined in

node_modules/@types/node/events.d.ts:334


errorMonitor

Static Readonly errorMonitor: typeof errorMonitor

Inherited from

Client.errorMonitor

Defined in

node_modules/@types/node/events.d.ts:327


plugins

Static plugins: PluginManager

Defined in

projects/framework/src/lib/SapphireClient.ts:347

Accessors

_censoredToken

Private get _censoredToken(): null | string

Returns

null | string

Inherited from

Client._censoredToken

Defined in

node_modules/discord.js/typings/index.d.ts:897


emojis

get emojis(): BaseGuildEmojiManager

Returns

BaseGuildEmojiManager

Inherited from

Client.emojis

Defined in

node_modules/discord.js/typings/index.d.ts:901


readyAt

get readyAt(): If<Ready, Date, null>

Returns

If<Ready, Date, null>

Inherited from

Client.readyAt

Defined in

node_modules/discord.js/typings/index.d.ts:904


uptime

get uptime(): If<Ready, number, null>

Returns

If<Ready, number, null>

Inherited from

Client.uptime

Defined in

node_modules/discord.js/typings/index.d.ts:909

Methods

addListener

addListener(eventName, listener): SapphireClient<Ready>

Parameters

NameType
eventNamestring | symbol
listener(...args: any[]) => void

Returns

SapphireClient<Ready>

Inherited from

Client.addListener

Defined in

node_modules/@types/node/events.d.ts:354


destroy

destroy(): void

Returns

void

Inherited from

Client.destroy

Defined in

node_modules/discord.js/typings/index.d.ts:914


emit

emit<K>(event, ...args): boolean

Type parameters

NameType
Kextends keyof ClientEvents

Parameters

NameType
eventK
...argsClientEvents[K]

Returns

boolean

Inherited from

Client.emit

Defined in

node_modules/discord.js/typings/index.d.ts:940

emit<S>(event, ...args): boolean

Type parameters

NameType
Sextends string | symbol

Parameters

NameType
eventExclude<S, keyof ClientEvents>
...argsunknown[]

Returns

boolean

Inherited from

Client.emit

Defined in

node_modules/discord.js/typings/index.d.ts:941


eventNames

eventNames(): (string | symbol)[]

Returns

(string | symbol)[]

Inherited from

Client.eventNames

Defined in

node_modules/@types/node/events.d.ts:669


fetchGuildPreview

fetchGuildPreview(guild): Promise<GuildPreview>

Parameters

NameType
guildGuildResolvable

Returns

Promise<GuildPreview>

Inherited from

Client.fetchGuildPreview

Defined in

node_modules/discord.js/typings/index.d.ts:915


fetchGuildTemplate

fetchGuildTemplate(template): Promise<GuildTemplate>

Parameters

NameType
templatestring

Returns

Promise<GuildTemplate>

Inherited from

Client.fetchGuildTemplate

Defined in

node_modules/discord.js/typings/index.d.ts:917


fetchGuildWidget

fetchGuildWidget(guild): Promise<Widget>

Parameters

NameType
guildGuildResolvable

Returns

Promise<Widget>

Inherited from

Client.fetchGuildWidget

Defined in

node_modules/discord.js/typings/index.d.ts:922


fetchInvite

fetchInvite(invite, options?): Promise<Invite>

Parameters

NameType
invitestring
options?ClientFetchInviteOptions

Returns

Promise<Invite>

Inherited from

Client.fetchInvite

Defined in

node_modules/discord.js/typings/index.d.ts:916


fetchPremiumStickerPacks

fetchPremiumStickerPacks(): Promise<Collection<string, StickerPack>>

Returns

Promise<Collection<string, StickerPack>>

Inherited from

Client.fetchPremiumStickerPacks

Defined in

node_modules/discord.js/typings/index.d.ts:920


fetchSticker

fetchSticker(id): Promise<Sticker>

Parameters

NameType
idstring

Returns

Promise<Sticker>

Inherited from

Client.fetchSticker

Defined in

node_modules/discord.js/typings/index.d.ts:919


fetchVoiceRegions

fetchVoiceRegions(): Promise<Collection<string, VoiceRegion>>

Returns

Promise<Collection<string, VoiceRegion>>

Inherited from

Client.fetchVoiceRegions

Defined in

node_modules/discord.js/typings/index.d.ts:918


fetchWebhook

fetchWebhook(id, token?): Promise<Webhook>

Parameters

NameType
idstring
token?string

Returns

Promise<Webhook>

Inherited from

Client.fetchWebhook

Defined in

node_modules/discord.js/typings/index.d.ts:921


generateInvite

generateInvite(options?): string

Parameters

NameType
options?InviteGenerationOptions

Returns

string

Inherited from

Client.generateInvite

Defined in

node_modules/discord.js/typings/index.d.ts:923


getMaxListeners

getMaxListeners(): number

Returns

number

Inherited from

Client.getMaxListeners

Defined in

node_modules/@types/node/events.d.ts:526


isReady

isReady(): this is Client<true>

Returns

this is Client<true>

Inherited from

Client.isReady

Defined in

node_modules/discord.js/typings/index.d.ts:925


listenerCount

listenerCount(eventName): number

Parameters

NameTypeDescription
eventNamestring | symbol

Returns

number

Inherited from

Client.listenerCount

Defined in

node_modules/@types/node/events.d.ts:616


listeners

listeners(eventName): Function[]

Parameters

NameType
eventNamestring | symbol

Returns

Function[]

Inherited from

Client.listeners

Defined in

node_modules/@types/node/events.d.ts:539


login

login(token?): Promise<string>

Parameters

NameTypeDescription
token?string

Returns

Promise<string>

Overrides

Client.login

Defined in

projects/framework/src/lib/SapphireClient.ts:322


off

off<K>(event, listener): SapphireClient<Ready>

Type parameters

NameType
Kextends keyof ClientEvents

Parameters

NameType
eventK
listener(...args: ClientEvents[K]) => Awaitable<void>

Returns

SapphireClient<Ready>

Inherited from

Client.off

Defined in

node_modules/discord.js/typings/index.d.ts:943

off<S>(event, listener): SapphireClient<Ready>

Type parameters

NameType
Sextends string | symbol

Parameters

NameType
eventExclude<S, keyof ClientEvents>
listener(...args: any[]) => Awaitable<void>

Returns

SapphireClient<Ready>

Inherited from

Client.off

Defined in

node_modules/discord.js/typings/index.d.ts:944


on

on<K>(event, listener): SapphireClient<Ready>

Type parameters

NameType
Kextends keyof ClientEvents

Parameters

NameType
eventK
listener(...args: ClientEvents[K]) => Awaitable<void>

Returns

SapphireClient<Ready>

Inherited from

Client.on

Defined in

node_modules/discord.js/typings/index.d.ts:928

on<S>(event, listener): SapphireClient<Ready>

Type parameters

NameType
Sextends string | symbol

Parameters

NameType
eventExclude<S, keyof ClientEvents>
listener(...args: any[]) => Awaitable<void>

Returns

SapphireClient<Ready>

Inherited from

Client.on

Defined in

node_modules/discord.js/typings/index.d.ts:929


once

once<K>(event, listener): SapphireClient<Ready>

Type parameters

NameType
Kextends keyof ClientEvents

Parameters

NameType
eventK
listener(...args: ClientEvents[K]) => Awaitable<void>

Returns

SapphireClient<Ready>

Inherited from

Client.once

Defined in

node_modules/discord.js/typings/index.d.ts:934

once<S>(event, listener): SapphireClient<Ready>

Type parameters

NameType
Sextends string | symbol

Parameters

NameType
eventExclude<S, keyof ClientEvents>
listener(...args: any[]) => Awaitable<void>

Returns

SapphireClient<Ready>

Inherited from

Client.once

Defined in

node_modules/discord.js/typings/index.d.ts:935


prependListener

prependListener(eventName, listener): SapphireClient<Ready>

Parameters

NameTypeDescription
eventNamestring | symbol
listener(...args: any[]) => void

Returns

SapphireClient<Ready>

Inherited from

Client.prependListener

Defined in

node_modules/@types/node/events.d.ts:634


prependOnceListener

prependOnceListener(eventName, listener): SapphireClient<Ready>

Parameters

NameTypeDescription
eventNamestring | symbol
listener(...args: any[]) => void

Returns

SapphireClient<Ready>

Inherited from

Client.prependOnceListener

Defined in

node_modules/@types/node/events.d.ts:650


rawListeners

rawListeners(eventName): Function[]

Parameters

NameType
eventNamestring | symbol

Returns

Function[]

Inherited from

Client.rawListeners

Defined in

node_modules/@types/node/events.d.ts:569


removeAllListeners

removeAllListeners<K>(event?): SapphireClient<Ready>

Type parameters

NameType
Kextends keyof ClientEvents

Parameters

NameType
event?K

Returns

SapphireClient<Ready>

Inherited from

Client.removeAllListeners

Defined in

node_modules/discord.js/typings/index.d.ts:949

removeAllListeners<S>(event?): SapphireClient<Ready>

Type parameters

NameType
Sextends string | symbol

Parameters

NameType
event?Exclude<S, keyof ClientEvents>

Returns

SapphireClient<Ready>

Inherited from

Client.removeAllListeners

Defined in

node_modules/discord.js/typings/index.d.ts:950


removeListener

removeListener(eventName, listener): SapphireClient<Ready>

Parameters

NameType
eventNamestring | symbol
listener(...args: any[]) => void

Returns

SapphireClient<Ready>

Inherited from

Client.removeListener

Defined in

node_modules/@types/node/events.d.ts:494


setMaxListeners

setMaxListeners(n): SapphireClient<Ready>

Parameters

NameType
nnumber

Returns

SapphireClient<Ready>

Inherited from

Client.setMaxListeners

Defined in

node_modules/@types/node/events.d.ts:520


toJSON

toJSON(): unknown

Returns

unknown

Inherited from

Client.toJSON

Defined in

node_modules/discord.js/typings/index.d.ts:926


getEventListeners

Static getEventListeners(emitter, name): Function[]

Parameters

NameType
emitterEventEmitter | _DOMEventTarget
namestring | symbol

Returns

Function[]

Inherited from

Client.getEventListeners

Defined in

node_modules/@types/node/events.d.ts:299


listenerCount

Static listenerCount(emitter, eventName): number

Parameters

NameTypeDescription
emitterEventEmitter
eventNamestring | symbol

Returns

number

Inherited from

Client.listenerCount

Defined in

node_modules/@types/node/events.d.ts:271


on

Static on(emitter, eventName, options?): AsyncIterableIterator<any>

Parameters

NameTypeDescription
emitterEventEmitter-
eventNamestring
options?StaticEventEmitterOptions-

Returns

AsyncIterableIterator<any>

Inherited from

Client.on

Defined in

node_modules/@types/node/events.d.ts:254

Static on<E, K>(eventEmitter, eventName): AsyncIterableIterator<E extends Client<boolean> ? ClientEvents[K] : any>

Type parameters

NameType
Eextends __module
Kextends keyof ClientEvents

Parameters

NameType
eventEmitterE
eventNameE extends Client<boolean> ? K : string

Returns

AsyncIterableIterator<E extends Client<boolean> ? ClientEvents[K] : any>

Inherited from

Client.on

Defined in

node_modules/discord.js/typings/index.d.ts:222


once

Static once(emitter, eventName, options?): Promise<any[]>

Parameters

NameType
emitter_NodeEventTarget
eventNamestring | symbol
options?StaticEventEmitterOptions

Returns

Promise<any[]>

Inherited from

Client.once

Defined in

node_modules/@types/node/events.d.ts:194

Static once(emitter, eventName, options?): Promise<any[]>

Parameters

NameType
emitter_DOMEventTarget
eventNamestring
options?StaticEventEmitterOptions

Returns

Promise<any[]>

Inherited from

Client.once

Defined in

node_modules/@types/node/events.d.ts:195

Static once<E, K>(eventEmitter, eventName): Promise<E extends Client<boolean> ? ClientEvents[K] : any[]>

Type parameters

NameType
Eextends __module
Kextends keyof ClientEvents

Parameters

NameType
eventEmitterE
eventNameE extends Client<boolean> ? K : string

Returns

Promise<E extends Client<boolean> ? ClientEvents[K] : any[]>

Inherited from

Client.once

Defined in

node_modules/discord.js/typings/index.d.ts:218


setMaxListeners

Static setMaxListeners(n?, ...eventTargets): void

Parameters

NameTypeDescription
n?number
...eventTargets(EventEmitter | _DOMEventTarget)[]-

Returns

void

Inherited from

Client.setMaxListeners

Defined in

node_modules/@types/node/events.d.ts:317


use

Static use(plugin): typeof SapphireClient

Parameters

NameType
plugintypeof Plugin

Returns

typeof SapphireClient

Defined in

projects/framework/src/lib/SapphireClient.ts:349