@sapphire/framework
Namespaces
- AliasPiece
- AllFlowsPrecondition
- ApplicationCommandRegistry
- Argument
- ArgumentError
- AutocompleteCommand
- ChatInputCommand
- Command
- ContextMenuCommand
- CorePreconditions
- InteractionHandler
- Listener
- MessageCommand
- Option
- Piece
- Precondition
- PreconditionError
- Resolvers
- Result
- Store
- UserError
Enumerations
- BucketScope
- CommandOptionsRunTypeEnum
- CommandPreConditions
- CooldownLevel
- Identifiers
- InteractionHandlerTypes
- InternalRegistryAPIType
- LogLevel
- PluginHook
- PreconditionRunCondition
- PreconditionRunMode
- RegisterBehavior
Classes
- AliasPiece
- AliasStore
- AllFlowsPrecondition
- ApplicationCommandRegistry
- Args
- Argument
- ArgumentError
- ArgumentStore
- ClientPermissionsPrecondition
- Command
- CommandStore
- Err
- InteractionHandler
- InteractionHandlerStore
- Listener
- ListenerStore
- LoaderError
- Logger
- MissingExportsError
- None
- Ok
- OptionError
- Piece
- Plugin
- PluginManager
- Precondition
- PreconditionContainerArray
- PreconditionContainerSingle
- PreconditionError
- PreconditionStore
- ResultError
- SapphireClient
- Some
- Store
- StoreRegistry
- UserError
- UserPermissionsPrecondition
Interfaces
- AliasPieceOptions
- ArgOptions
- ArgType
- ArgsJson
- ArgsNextCallback
- ArgumentContext
- ArgumentOptions
- AutocompleteCommandContext
- AutocompleteInteractionPayload
- BooleanArgumentContext
- ChatInputCommandAcceptedPayload
- ChatInputCommandContext
- ChatInputCommandDeniedPayload
- ChatInputCommandErrorPayload
- ChatInputCommandFinishPayload
- ChatInputCommandRunPayload
- ChatInputCommandSuccessPayload
- ClientLoggerOptions
- CommandDoesNotHaveChatInputCommandHandlerPayload
- CommandDoesNotHaveContextMenuCommandHandlerPayload
- CommandDoesNotHaveMessageCommandHandler
- CommandJSON
- CommandOptions
- ContextMenuCommandAcceptedPayload
- ContextMenuCommandContext
- ContextMenuCommandDeniedPayload
- ContextMenuCommandErrorPayload
- ContextMenuCommandFinishPayload
- ContextMenuCommandRunPayload
- ContextMenuCommandSuccessPayload
- CooldownOptions
- DetailedDescriptionCommandObject
- EmojiObject
- EnumArgumentContext
- IArgument
- IChatInputCommandPayload
- IContextMenuCommandPayload
- IInteractionHandlerPayload
- ILogger
- IMessageCommandPayload
- IOption
- IPieceError
- IPreconditionCondition
- IPreconditionContainer
- IResult
- InteractionHandlerError
- InteractionHandlerJSON
- InteractionHandlerOptions
- InteractionHandlerParseError
- InteractionHandlerParseNone
- InteractionHandlerParseSome
- InteractionHandlerParseSuccess
- ListenerErrorPayload
- ListenerJSON
- ListenerOptions
- MemberArgumentContext
- MessageCommandAcceptedPayload
- MessageCommandContext
- MessageCommandDeniedPayload
- MessageCommandErrorPayload
- MessageCommandFinishPayload
- MessageCommandRunPayload
- MessageCommandSuccessPayload
- MessageCommandTypingErrorPayload
- MessageResolverOptions
- PieceContext
- PieceOptions
- PreChatInputCommandRunPayload
- PreContextMenuCommandRunPayload
- PreMessageCommandRunPayload
- PreconditionArrayResolvableDetails
- PreconditionContext
- PreconditionOptions
- PreconditionSingleResolvableDetails
- Preconditions
- RepeatArgOptions
- SapphireClientOptions
- SapphirePluginAsyncHook
- SapphirePluginHook
- SapphirePluginHookEntry
- SapphirePrefixHook
- SimplePreconditionSingleResolvableDetails
- StoreOptions
- StoreRegistryEntries
- UnknownChatInputCommandPayload
- UnknownContextMenuCommandPayload
- UnknownMessageCommandNamePayload
- UnknownMessageCommandPayload
Type Aliases
ApplicationCommandRegistryRegisterOptions
Ƭ ApplicationCommandRegistryRegisterOptions: RegisterOptions
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:546
ArgumentResult
Ƭ ArgumentResult<T
>: Result
<T
, ArgumentError
<T
>>
Defines a synchronous result of an Argument, check AsyncResult for the asynchronous version.
Type parameters
Name |
---|
T |
Defined in
projects/framework/src/lib/structures/Argument.ts:13
ArrayResultType
Ƭ ArrayResultType<T
>: Result
<T
[], UserError
| ArgumentError
<T
>>
Type parameters
Name |
---|
T |
Defined in
projects/framework/src/lib/parsers/Args.ts:826
AsyncArgumentResult
Ƭ AsyncArgumentResult<T
>: Promise
<ArgumentResult
<T
>>
Defines an asynchronous result of an Argument, check Result for the synchronous version.
Type parameters
Name |
---|
T |
Defined in
projects/framework/src/lib/structures/Argument.ts:23
AsyncPluginHooks
Ƭ AsyncPluginHooks: PreLogin
| PostLogin
Defined in
projects/framework/src/lib/plugins/PluginManager.ts:8
AsyncPreconditionContainerReturn
Ƭ AsyncPreconditionContainerReturn: Promise
<PreconditionContainerResult
>
Async-only version of PreconditionContainerReturn, to be used when the run method is async.
Since
1.0.0
Defined in
projects/framework/src/lib/utils/preconditions/IPreconditionContainer.ts:24
AsyncPreconditionResult
Ƭ AsyncPreconditionResult: Promise
<Result
<unknown
, UserError
>>
Defined in
projects/framework/src/lib/structures/Precondition.ts:20
AutocompleteCommand
Ƭ AutocompleteCommand: Command
& Required
<Pick
<Command
, "autocompleteRun"
>>
Defined in
projects/framework/src/lib/structures/Command.ts:506
projects/framework/src/lib/structures/Command.ts:508
Awaitable
Ƭ Awaitable<T
>: PromiseLike
<T
> | T
ReturnType for a function that can return either a value or a Promise
with that value
Type parameters
Name |
---|
T |
Defined in
node_modules/@sapphire/utilities/dist/lib/types.d.ts:44
AwaitableArgumentResult
Ƭ AwaitableArgumentResult<T
>: Awaitable
<ArgumentResult
<T
>>
Defines a synchronous or asynchronous result of an Argument, check AsyncResult for the asynchronous version.
Type parameters
Name |
---|
T |
Defined in
projects/framework/src/lib/structures/Argument.ts:18
ChatInputCommand
Ƭ ChatInputCommand: Command
& Required
<Pick
<Command
, "chatInputRun"
>>
Defined in
projects/framework/src/lib/structures/Command.ts:482
projects/framework/src/lib/structures/Command.ts:484
CommandOptionsRunType
Ƭ CommandOptionsRunType: "DM"
| "GUILD_TEXT"
| "GUILD_VOICE"
| "GUILD_NEWS"
| "GUILD_NEWS_THREAD"
| "GUILD_PUBLIC_THREAD"
| "GUILD_PRIVATE_THREAD"
| "GUILD_ANY"
The allowed values for runIn.
Remark
It is discouraged to use this type, we recommend using CommandOptionsRunTypeEnum instead.
Since
2.0.0
Defined in
projects/framework/src/lib/structures/Command.ts:523
ContextMenuCommand
Ƭ ContextMenuCommand: Command
& Required
<Pick
<Command
, "contextMenuRun"
>>
Defined in
projects/framework/src/lib/structures/Command.ts:494
projects/framework/src/lib/structures/Command.ts:496
DetailedDescriptionCommand
Ƭ DetailedDescriptionCommand: string
| DetailedDescriptionCommandObject
Defined in
projects/framework/src/lib/structures/Command.ts:788
InteractionHandlerParseResult
Ƭ InteractionHandlerParseResult<Instance
>: UnwrapSome
<Awaited
<ReturnType
<Instance
["parse"
]>>>
Type parameters
Name | Type |
---|---|
Instance | extends InteractionHandler |
Defined in
projects/framework/src/lib/structures/InteractionHandler.ts:103
LogMethods
Ƭ LogMethods: "trace"
| "debug"
| "info"
| "warn"
| "error"
Defined in
projects/framework/src/lib/utils/logger/Logger.ts:54
MessageArgumentContext
Ƭ MessageArgumentContext: Omit
<MessageResolverOptions
, "messageOrInteraction"
> & Context
The context for the 'message'
argument.
Since
4.2.0 (🌿)
Defined in
projects/framework/src/lib/types/ArgumentContexts.ts:53
MessageCommand
Ƭ MessageCommand: Command
& Required
<Pick
<Command
, "messageRun"
>>
Defined in
projects/framework/src/lib/structures/Command.ts:472
projects/framework/src/lib/structures/Command.ts:474
Option
The union of the two variations of Option
.
Typeparam
T The value's type.
Type parameters
Name |
---|
T |
Defined in
node_modules/@sapphire/result/dist/index.d.ts:1819
node_modules/@sapphire/result/dist/index.d.ts:1820
PreconditionArrayResolvable
Ƭ PreconditionArrayResolvable: readonly PreconditionEntryResolvable
[] | PreconditionArrayResolvableDetails
Defines the data accepted by PreconditionContainerArray's constructor.
Since
1.0.0
Defined in
projects/framework/src/lib/utils/preconditions/PreconditionContainerArray.ts:75
PreconditionContainerResult
Ƭ PreconditionContainerResult: Result
<unknown
, UserError
>
Defines the result's value for a PreconditionContainer.
Since
1.0.0
Defined in
projects/framework/src/lib/utils/preconditions/IPreconditionContainer.ts:12
PreconditionContainerReturn
Ƭ PreconditionContainerReturn: Awaitable
<PreconditionContainerResult
>
Defines the return type of the generic messageRun.
Since
1.0.0
Defined in
projects/framework/src/lib/utils/preconditions/IPreconditionContainer.ts:18
PreconditionEntryResolvable
Ƭ PreconditionEntryResolvable: PreconditionSingleResolvable
| PreconditionArrayResolvable
Defines the data accepted for each entry of the array.
Since
1.0.0
Seealso
Seealso
Defined in
projects/framework/src/lib/utils/preconditions/PreconditionContainerArray.ts:83
PreconditionKeys
Ƭ PreconditionKeys: keyof Preconditions
Defined in
projects/framework/src/lib/structures/Precondition.ts:154
PreconditionResult
Ƭ PreconditionResult: Awaitable
<Result
<unknown
, UserError
>>
Defined in
projects/framework/src/lib/structures/Precondition.ts:19
PreconditionSingleResolvable
Ƭ PreconditionSingleResolvable: SimplePreconditionKeys
| SimplePreconditionSingleResolvableDetails
| PreconditionSingleResolvableDetails
Defines the data accepted by PreconditionContainerSingle's constructor.
Since
1.0.0
Defined in
projects/framework/src/lib/utils/preconditions/PreconditionContainerSingle.ts:46
Result
Ƭ Result<T
, E
>: Ok
<T
> | Err
<E
>
The union of the two variations of Result
.
Typeparam
T The result's type.
Typeparam
E The error's type.
Type parameters
Name |
---|
T |
E |
Defined in
node_modules/@sapphire/result/dist/index.d.ts:901
node_modules/@sapphire/result/dist/index.d.ts:902
ResultType
Ƭ ResultType<T
>: Result
<T
, UserError
| ArgumentError
<T
>>
Type parameters
Name |
---|
T |
Defined in
projects/framework/src/lib/parsers/Args.ts:825
SapphirePrefix
Ƭ SapphirePrefix: string
| readonly string
[] | null
A valid prefix in Sapphire.
string
: a single prefix, e.g.'!'
.string[]
: an array of prefixes, e.g.['!', '.']
.null
: disabled prefix, locks the bot's command usage to mentions only.
Defined in
projects/framework/src/lib/SapphireClient.ts:26
SimplePreconditionKeys
Ƭ SimplePreconditionKeys: { [K in PreconditionKeys]: Preconditions[K] extends never ? K : never }[PreconditionKeys
]
Defined in
projects/framework/src/lib/structures/Precondition.ts:155
SyncPluginHooks
Ƭ SyncPluginHooks: Exclude
<PluginHook
, AsyncPluginHooks
>
Defined in
projects/framework/src/lib/plugins/PluginManager.ts:13
Variables
ApplicationCommandRegistries
• Const
ApplicationCommandRegistries: Object
Type declaration
Name | Type |
---|---|
acquire | (commandName : string ) => ApplicationCommandRegistry |
getDefaultBehaviorWhenNotIdentical | () => RegisterBehavior |
getDefaultGuildIds | () => undefined | string [] |
setDefaultBehaviorWhenNotIdentical | (behavior? : null | RegisterBehavior ) => void |
setDefaultGuildIds | (guildIds? : null | string []) => void |
get registries() | ReadonlyMap <string , ApplicationCommandRegistry > |
Defined in
projects/framework/src/index.ts:26
CorePreconditions
• Const
CorePreconditions: Object
Type declaration
Name | Type |
---|---|
ClientPermissions | typeof CorePrecondition |
Cooldown | typeof CorePrecondition |
DMOnly | typeof CorePrecondition |
Enabled | typeof CorePrecondition |
GuildNewsOnly | typeof CorePrecondition |
GuildNewsThreadOnly | typeof CorePrecondition |
GuildOnly | typeof CorePrecondition |
GuildPrivateThreadOnly | typeof CorePrecondition |
GuildPublicThreadOnly | typeof CorePrecondition |
GuildTextOnly | typeof CorePrecondition |
GuildThreadOnly | typeof CorePrecondition |
GuildVoiceOnly | typeof CorePrecondition |
NSFW | typeof CorePrecondition |
RunIn | typeof CorePrecondition |
UserPermissions | typeof CorePrecondition |
Defined in
projects/framework/src/index.ts:96
projects/framework/src/index.ts:124
Events
• Const
Events: Object
Type declaration
Name | Type | Description |
---|---|---|
ApplicationCommandPermissionsUpdate | ApplicationCommandPermissionsUpdate | - |
ApplicationCommandRegistriesBulkOverwriteError | "applicationCommandRegistriesBulkOverwriteError" | Emitted when an error is encountered when handling the command registries in bulk overwrite mode. Param The error that was thrown Param The guild id where the error was thrown |
ApplicationCommandRegistriesInitialising | "applicationCommandRegistriesInitialising" | Emitted when the application command registries are being initialized. |
ApplicationCommandRegistriesRegistered | "applicationCommandRegistriesRegistered" | Emitted once the application command registries have been initialized. Param The initialised registries |
AutoModerationActionExecution | AutoModerationActionExecution | - |
AutoModerationRuleCreate | AutoModerationRuleCreate | - |
AutoModerationRuleDelete | AutoModerationRuleDelete | - |
AutoModerationRuleUpdate | AutoModerationRuleUpdate | - |
CacheSweep | CacheSweep | - |
ChannelCreate | ChannelCreate | - |
ChannelDelete | ChannelDelete | - |
ChannelPinsUpdate | ChannelPinsUpdate | - |
ChannelUpdate | ChannelUpdate | - |
ChatInputCommandAccepted | "chatInputCommandAccepted" | Emitted when a chat input command passes all precondition checks, if any. Param The contextual payload |
ChatInputCommandDenied | "chatInputCommandDenied" | Emitted when a precondition denies a chat input command from being run. Param The error reported by the precondition Param The contextual payload |
ChatInputCommandError | "chatInputCommandError" | Emitted after a chat input command runs unsuccesfully. Param The error that was thrown Param The contextual payload |
ChatInputCommandFinish | "chatInputCommandFinish" | Emitted directly after a chat input command finished running, regardless of the outcome. Param The interaction that executed the command Param The command that finished running Param The contextual payload |
ChatInputCommandRun | "chatInputCommandRun" | Emitted directly before a chat input command is run. Param The interaction that executed the command Param The command that is being run Param The contextual payload |
ChatInputCommandSuccess | "chatInputCommandSuccess" | Emitted after a chat input command runs successfully. Param The contextual payload |
ClientReady | ClientReady | - |
CommandApplicationCommandRegistryError | "commandApplicationCommandRegistryError" | Emitted when an error is encountered when handling the command application command registry. Param The error that was thrown Param The command whose registry caused the error |
CommandAutocompleteInteractionError | "commandAutocompleteInteractionError" | Emitted when an error is encountered when executing an autocomplete interaction handler. Param The error that was encountered Param The contextual payload |
CommandAutocompleteInteractionSuccess | "commandAutocompleteInteractionSuccess" | Emitted after an autocomplete interaction handler runs successfully. Param The contextual payload |
CommandDoesNotHaveChatInputCommandHandler | "commandDoesNotHaveChatInputCommandHandler" | Emitted when a chat input command is executed but a chatInputRun method is not found. Param The contextual payload |
CommandDoesNotHaveContextMenuCommandHandler | "commandDoesNotHaveContextMenuCommandHandler" | Emitted when a chat input command is executed but a contextMenuRun method is not found. Param The contextual payload |
CommandDoesNotHaveMessageCommandHandler | "commandDoesNotHaveMessageCommandHandler" | Emitted when a message command is executed but a messageRun method is not found. Param The contextual payload |
ContextMenuCommandAccepted | "contextMenuCommandAccepted" | Emitted when a context menu command passes all precondition checks, if any. Param The contextual payload |
ContextMenuCommandDenied | "contextMenuCommandDenied" | Emitted when a precondition denies a context menu command from being run. Param The error reported by the precondition Param The contextual payload |
ContextMenuCommandError | "contextMenuCommandError" | Emitted after a context menu command runs unsuccesfully. Param The error that was thrown Param The contextual payload |
ContextMenuCommandFinish | "contextMenuCommandFinish" | Emitted directly after a context menu command finished running, regardless of the outcome. Param The interaction that executed the command Param The command that finished running Param The contextual payload |
ContextMenuCommandRun | "contextMenuCommandRun" | Emitted directly before a context menu command is run. Param The interaction that executed the command Param The command that is being run Param The contextual payload |
ContextMenuCommandSuccess | "contextMenuCommandSuccess" | Emitted after a context menu command runs successfully. Param The contextual payload |
Debug | Debug | - |
Error | Error | - |
GuildBanAdd | GuildBanAdd | - |
GuildBanRemove | GuildBanRemove | - |
GuildCreate | GuildCreate | - |
GuildDelete | GuildDelete | - |
GuildEmojiCreate | GuildEmojiCreate | - |
GuildEmojiDelete | GuildEmojiDelete | - |
GuildEmojiUpdate | GuildEmojiUpdate | - |
GuildIntegrationsUpdate | GuildIntegrationsUpdate | - |
GuildMemberAdd | GuildMemberAdd | - |
GuildMemberAvailable | GuildMemberAdd | - |
GuildMemberRemove | GuildMemberRemove | - |
GuildMemberUpdate | GuildMemberUpdate | - |
GuildMembersChunk | GuildMembersChunk | - |
GuildRoleCreate | GuildRoleCreate | - |
GuildRoleDelete | GuildRoleDelete | - |
GuildRoleUpdate | GuildRoleUpdate | - |
GuildScheduledEventCreate | GuildScheduledEventCreate | - |
GuildScheduledEventDelete | GuildScheduledEventDelete | - |
GuildScheduledEventUpdate | GuildScheduledEventUpdate | - |
GuildScheduledEventUserAdd | GuildScheduledEventUserAdd | - |
GuildScheduledEventUserRemove | GuildScheduledEventUserRemove | - |
GuildStickerCreate | GuildStickerCreate | - |
GuildStickerDelete | GuildStickerDelete | - |
GuildStickerUpdate | GuildStickerUpdate | - |
GuildUnavailable | GuildUnavailable | - |
GuildUpdate | GuildUpdate | - |
InteractionCreate | InteractionCreate | - |
InteractionHandlerError | "interactionHandlerError" | Emitted when an error is encountered when executing an interaction handler. Param The error that was encountered Param The contextual payload |
InteractionHandlerParseError | "interactionHandlerParseError" | Emitted when the parse method of an interaction handler encounters an error. Param The error that was encountered Param The contextual payload |
InteractionHandlerParseNone | "interactionHandlerParseNone" | Emitted when the parse method of an interaction handler passes successfully (no errors are encountered) and none is returned. Param The None from the parse method. Param The contextual payload |
InteractionHandlerParseSome | "interactionHandlerParseSome" | Emitted when the parse method of an interaction handler passes successfully (no errors are encountered) and some is returned. Param The Some from the parse method. Param The contextual payload |
InteractionHandlerParseSuccess | "interactionHandlerParseSuccess" | Emitted when the parse method of an interaction handler passes successfully (no errors are encountered) Use the option parameter to determine if some or none was passed. Param The Option from the parse method. Param The contextual payload |
Invalidated | Invalidated | - |
InviteCreate | InviteCreate | - |
InviteDelete | InviteDelete | - |
ListenerError | "listenerError" | Emitted when an error is encountered when executing a listener. Param The error that was thrown Param The contextual payload |
MentionPrefixOnly | "mentionPrefixOnly" | Emitted when a message is created consisting of only the bot's mention. Param The created message |
MessageBulkDelete | MessageBulkDelete | - |
MessageCommandAccepted | "messageCommandAccepted" | Emitted when a message command passes all precondition checks, if any. Param The contextual payload |
MessageCommandDenied | "messageCommandDenied" | Emitted when a precondition denies a message command from being run. Param The error reported by the precondition Param The contextual payload |
MessageCommandError | "messageCommandError" | Emitted after a message command runs unsuccesfully. Param The error that was thrown Param The contextual payload |
MessageCommandFinish | "messageCommandFinish" | Emitted directly after a message command finished running, regardless of the outcome. Param The message that executed the command Param The command that finished running Param The contextual payload |
MessageCommandRun | "messageCommandRun" | Emitted directly before a message command is run. Param The message that executed the command Param The command that is being run Param The contextual payload |
MessageCommandSuccess | "messageCommandSuccess" | Emitted after a message command runs successfully. Param The contextual payload |
MessageCommandTypingError | "messageCommandTypingError" | Emitted after the bot unsuccessfully tried to start typing when a command is executed. Param The error that was thrown Param The contextual payload |
MessageCreate | MessageCreate | - |
MessageDelete | MessageDelete | - |
MessageReactionAdd | MessageReactionAdd | - |
MessageReactionRemove | MessageReactionRemove | - |
MessageReactionRemoveAll | MessageReactionRemoveAll | - |
MessageReactionRemoveEmoji | MessageReactionRemoveEmoji | - |
MessageUpdate | MessageUpdate | - |
NonPrefixedMessage | "nonPrefixedMessage" | Emitted when a message is created that does not start with a valid prefix. Param The created message |
PiecePostLoad | "piecePostLoad" | Emitted after a piece is loaded. Param The store in which the piece belongs to Param The piece that was loaded |
PieceUnload | "pieceUnload" | Emitted when a piece is unloaded. Param The store in which the piece belongs to Param The piece that was unloaded |
PluginLoaded | "pluginLoaded" | Emitted when a plugin is loaded. Param The plugin hook that was loaded Param The name of the plugin, if any |
PossibleAutocompleteInteraction | "possibleAutocompleteInteraction" | Emitted when an autocomplete interaction is recieved. Param The interaction that was recieved |
PossibleChatInputCommand | "possibleChatInputCommand" | Emitted when a chat input command interaction is recieved. Param The interaction that was recieved. |
PossibleContextMenuCommand | "possibleContextMenuCommand" | Emitted when a context menu interaction is recieved. Param The interaction that was recieved. |
PreChatInputCommandRun | "preChatInputCommandRun" | Emitted before the chatInputRun method of a command is run. Param The contextual payload |
PreContextMenuCommandRun | "preContextMenuCommandRun" | Emitted before the contextMenuRun method of a command is run. Param The contextual payload |
PreMessageCommandRun | "preMessageCommandRun" | Emitted before the messageRun method of a command is run. Param The contextual payload |
PreMessageParsed | "preMessageParsed" | Emitted when a message is created that was not sent by bots or webhooks. Param The created message |
PrefixedMessage | "prefixedMessage" | Emitted when a message is created that does starts with a valid prefix. Param The created message |
PresenceUpdate | PresenceUpdate | - |
Raw | Raw | - |
ShardDisconnect | ShardDisconnect | - |
ShardError | ShardError | - |
ShardReady | ShardReady | - |
ShardReconnecting | ShardReconnecting | - |
ShardResume | ShardResume | - |
StageInstanceCreate | StageInstanceCreate | - |
StageInstanceDelete | StageInstanceDelete | - |
StageInstanceUpdate | StageInstanceUpdate | - |
ThreadCreate | ThreadCreate | - |
ThreadDelete | ThreadDelete | - |
ThreadListSync | ThreadListSync | - |
ThreadMemberUpdate | ThreadMemberUpdate | - |
ThreadMembersUpdate | ThreadMembersUpdate | - |
ThreadUpdate | ThreadUpdate | - |
TypingStart | TypingStart | - |
UnknownChatInputCommand | "unknownChatInputCommand" | Emitted when the name of a sent chat input command does not match any loaded commands. Param The contextual payload |
UnknownContextMenuCommand | "unknownContextMenuCommand" | Emitted when the name of a sent context menu command does not match any loaded commands. Param The contextual payload |
UnknownMessageCommand | "unknownMessageCommand" | Emitted when the name of a sent message command does not match any loaded commands. Param The contextual payload |
UnknownMessageCommandName | "unknownMessageCommandName" | Emitted when a message starts with a valid prefix but does not include a command name. Param |
UserUpdate | UserUpdate | - |
VoiceServerUpdate | VoiceServerUpdate | - |
VoiceStateUpdate | VoiceStateUpdate | - |
Warn | Warn | - |
WebhooksUpdate | WebhooksUpdate | - |
Defined in
projects/framework/src/lib/types/Events.ts:27
InteractionHandlerFilters
• Const
InteractionHandlerFilters: Map
<InteractionHandlerTypes
, (interaction
: Interaction
) => boolean
>
Defined in
projects/framework/src/lib/structures/InteractionHandlerStore.ts:87
PreconditionConditionAnd
• Const
PreconditionConditionAnd: IPreconditionCondition
An IPreconditionCondition which runs all containers similarly to doing (V0 && V1 [&& V2 [&& V3 ...]]).
Since
1.0.0
Defined in
projects/framework/src/lib/utils/preconditions/conditions/PreconditionConditionAnd.ts:8
PreconditionConditionOr
• Const
PreconditionConditionOr: IPreconditionCondition
An IPreconditionCondition which runs all containers similarly to doing (V0 || V1 [|| V2 [|| V3 ...]]).
Since
1.0.0
Defined in
projects/framework/src/lib/utils/preconditions/conditions/PreconditionConditionOr.ts:9
container
• Const
container: Container
The injected variables that will be accessible to any place. To add an extra property, simply add a property with a regular assignment, and it will be available in all places simultaneously.
Example
// Add a reference for the version:
import { container } from '@sapphire/pieces';
container.version = '1.0.0';
// Can be placed anywhere in a TypeScript file, for JavaScript projects,
// you can create an `augments.d.ts` and place the code there.
declare module '@sapphire/pieces' {
interface Container {
version: string;
}
}
// In any piece, core, plugin, or custom:
export class UserCommand extends Command {
public run(message, args) {
// The injected version is available here:
const { version } = this.container;
// ...
}
}
Example
// In a plugin's context, e.g. API:
class Api extends Plugin {
static [postInitialization]() {
const server = new Server(this);
container.server = server;
// ...
}
}
declare module '@sapphire/pieces' {
interface Container {
server: Server;
}
}
// In any piece, even those that aren't routes nor middlewares:
export class UserRoute extends Route {
public [methods.POST](message, args) {
// The injected server is available here:
const { server } = this.container;
// ...
}
}
Defined in
node_modules/@sapphire/pieces/dist/index.d.ts:645
none
• Const
none: None
Defined in
node_modules/@sapphire/result/dist/index.d.ts:1809
postInitialization
• Const
postInitialization: unique symbol
Defined in
projects/framework/src/lib/plugins/symbols.ts:3
postLogin
• Const
postLogin: unique symbol
Defined in
projects/framework/src/lib/plugins/symbols.ts:6
preGenericsInitialization
• Const
preGenericsInitialization: unique symbol
Defined in
projects/framework/src/lib/plugins/symbols.ts:1
preInitialization
• Const
preInitialization: unique symbol
Defined in
projects/framework/src/lib/plugins/symbols.ts:2
preLogin
• Const
preLogin: unique symbol
Defined in
projects/framework/src/lib/plugins/symbols.ts:5
version
• Const
version: string
= '[VI]{{inject}}[/VI]'
The @sapphire/framework version that you are currently using. An example use of this is showing it of in a bot information command.
Note to Sapphire developers: This needs to explicitly be string
so it is not typed as the string that gets replaced by esbuild
Defined in
projects/framework/src/index.ts:136
Functions
err
▸ err(): Err
<unknown
>
Creates an Err with no error.
Returns
Err
<unknown
>
An erroneous Result.
Defined in
node_modules/@sapphire/result/dist/index.d.ts:1755
▸ err<E
>(x
): Err
<E
>
Creates an Err.
Type parameters
Name |
---|
E |
Parameters
Name | Type | Description |
---|---|---|
x | E | Value to use. |
Returns
Err
<E
>
An erroneous Result.
Typeparam
E The error's type.
Defined in
node_modules/@sapphire/result/dist/index.d.ts:1762
ok
▸ ok(): Ok
<unknown
>
Creates an Ok with no value.
Returns
Ok
<unknown
>
A successful Result.
Defined in
node_modules/@sapphire/result/dist/index.d.ts:881
▸ ok<T
>(x
): Ok
<T
>
Creates an Ok.
Type parameters
Name |
---|
T |
Parameters
Name | Type | Description |
---|---|---|
x | T | Value to use. |
Returns
Ok
<T
>
A successful Result.
Typeparam
T The result's type.
Defined in
node_modules/@sapphire/result/dist/index.d.ts:888
some
▸ some<T
>(value
): Some
<T
>
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
value | T |
Returns
Some
<T
>
Defined in
node_modules/@sapphire/result/dist/index.d.ts:1702