Skip to main content

Interface: SapphireClientOptions

Properties

baseUserDirectory

Optional baseUserDirectory: null | string | URL

The base user directory, if set to null, Sapphire will not call (), meaning that you will need to manually set each folder for each store or use (). Please read the aforementioned methods' documentation for more information.

Since

1.0.0

Default

undefined

Defined in

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


caseInsensitiveCommands

Optional caseInsensitiveCommands: null | boolean

Whether commands can be case-insensitive

Since

1.0.0

Default

false

Defined in

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


caseInsensitivePrefixes

Optional caseInsensitivePrefixes: null | boolean

Whether prefixes can be case-insensitive

Since

1.0.0

Default

false

Defined in

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


defaultCooldown

Optional defaultCooldown: CooldownOptions

Sets the default cooldown time for all commands.

Default

"No cooldown options"

Defined in

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


defaultPrefix

Optional defaultPrefix: SapphirePrefix

The default prefix, in case of null, only mention prefix will trigger the bot's commands.

Since

1.0.0

Default

null

Defined in

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


disableMentionPrefix

Optional disableMentionPrefix: boolean

Controls whether the bot has mention as a prefix disabled

Default

false

Defined in

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


enableLoaderTraceLoggings

Optional enableLoaderTraceLoggings: boolean

Whether trace logging should be enabled.

Since

2.0.0

Default

container.logger.has(LogLevel.Trace)

Defined in

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


fetchPrefix

Optional fetchPrefix: SapphirePrefixHook

The prefix hook, by default it is a callback function that returns SapphireClientOptions.defaultPrefix.

Since

1.0.0

Default

() => client.options.defaultPrefix

Defined in

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


id

Optional id: string

The client's ID, this is automatically set by the CoreReady event.

Since

1.0.0

Default

this.client.user?.id ?? null

Defined in

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


loadApplicationCommandRegistriesStatusListeners

Optional loadApplicationCommandRegistriesStatusListeners: boolean

If Sapphire should load the pre-included application command registries status listeners that log the status of registering application commands to the SapphireClient.logger instance. This includes the events Events.ApplicationCommandRegistriesInitialising and Events.ApplicationCommandRegistriesRegistered.

Since

4.4.0

Default

true

Defined in

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


loadDefaultErrorListeners

Optional loadDefaultErrorListeners: boolean

If Sapphire should load the pre-included error event listeners that log any encountered errors to the SapphireClient.logger instance

Since

1.0.0

Default

true

Defined in

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


loadMessageCommandListeners

Optional loadMessageCommandListeners: boolean

If Sapphire should load the pre-included message command listeners that are used to process incoming messages for commands.

Since

3.0.0

Default

false

Defined in

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


logger

Optional logger: ClientLoggerOptions

The logger options, defaults to an instance of Logger when ClientLoggerOptions.instance is not specified.

Since

1.0.0

Default

{ instance: new Logger(LogLevel.Info) }

Defined in

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


preventFailedToFetchLogForGuilds

Optional preventFailedToFetchLogForGuilds: true | string[]

Whenever starting the bot process Sapphire may report errors when failing to fetch guild commands. One of the causes for this can be when a bot was invited to a server without the application.commands scope.

Normally this produce a log in the console at the WARN level, however because bot lists have a tendency to invite your bot specifically without the scope to ensure that your Chat Input and Context Menu commands do not show up as usable commands in that server, you may want to include their guild ids in this list.

By adding ids to this list, whenever a guild id matches one of the ids in the list no warning log message will be emitted for that guild.

By setting this value to true, no warning log message will be emitted for any guilds we couldn't fetch the commands from.

Note that this specifically applies to the warning log:

ApplicationCommandRegistries: Failed to fetch guild commands for guild <guild name> (<guild id>). Make sure to authorize your application with the "applications.commands" scope in that guild.

Defined in

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


regexPrefix

Optional regexPrefix: RegExp

The regex prefix, an alternative to a mention or regular prefix to allow creating natural language command messages

Since

1.0.0

Example

/^(hey +)?bot[,! ]/i

// Matches:
// - hey bot,
// - hey bot!
// - hey bot
// - bot,
// - bot!
// - bot

Defined in

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


typing

Optional typing: boolean

Controls whether the bot will automatically appear to be typing when a command is accepted.

Default

false

Defined in

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