Skip to main content

Interface: SapphireClientOptions

Properties

baseUserDirectory

Optional baseUserDirectory: null | string

The base user directory, if set to null, Sapphire will not call StoreRegistry.registerPath, meaning that you will need to manually set each folder for each store. Please read the aforementioned method's documentation for more information.

since 1.0.0

default undefined

Defined in

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


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:47


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:54


defaultCooldown

Optional defaultCooldown: CooldownOptions

Sets the default cooldown time for all commands.

default "No cooldown options"

Defined in

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


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:61


disableMentionPrefix

Optional disableMentionPrefix: boolean

Controls whether the bot has mention as a prefix disabled

default false

Defined in

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


enableLoaderTraceLoggings

Optional enableLoaderTraceLoggings: boolean

Whether or not trace logging should be enabled.

since 2.0.0

default container.logger.has(LogLevel.Trace)

Defined in

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


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:86


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:93


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:114


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:121


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:100


preventFailedToFetchLogForGuildIds

Optional preventFailedToFetchLogForGuildIds: 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.

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:154


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:79


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:127