Sapphire - Imagine a Framework

SIA

Sapphire - Imagine a Framework

Sapphire is a next-gen object-oriented Discord.js bot framework.

Join

sapphire-support

discordjs-support

old-sapphire-support

old-discordjs-support

old-application-commands-and-interactions

Validation error when importing builders from `discord.js` rather than `@discordjs/builders`

I ended up opening a thread on the d.js server because I thought it was related to it but turns out seems to only happen when used with Sapphire ```ts import { Command } from '@sapphire/framework'; import { SlashCommandSubcommandBuilder } from 'discord.js';...

How can I partition custom id schemas using `@sapphire/string-store`

I created 2 different schema stores, where each store keeps track of schemas for a particular feature of the bot. I then use the parse method of interaction handlers to determine whether a given interaction should be handled by it, as such: ```ts public override async parse(interaction: ButtonInteraction) { const deserializedCustomId = MinesGameQuickPlayConfigurationMessage.customIdStore.deserialize(interaction.customId);...

PaginatedMessage "This maze wasn't meant for you...what did you do." on a user app

Almost (?) the same issue with https://discord.com/channels/737141877803057244/1151938957806940160, but this time on a user app. Trying to run a command in a guild channel but it gets logged saying it came from a DM. Here's some info that might be helpful: The intents and partials ```ts...

A cleaner web experience for this forum

Hey! I saw this forum AnswerOverflow. I’m building Paladin, a smoother, cleaner alternative that makes Discord forums easier to browse on the web. It’s free to use and can run alongside AnswerOverflow, so you don’t have to switch anything to try it out. If it’s helpful, I can spin up a version of Paladin on your forum so you can see how it looks for your community. Is there anything about your current setup you’d like improved? I’d love to see if Paladin can help. 😀 Example Paladin preview attached...
No description

Ping command in the Guide does not work

I tried following the Getting started Guide for Sapphire but it seems like the bot wont register me sending @bot ping in a channel it has access to. I am using Typescript, with the source being in src/ and being built to dist/. My Main property in the package.json is dist/index.js Code should be the exact same. Is there a paste service i can use for samples?...
No description

TypeError: Cannot read properties of undefined (reading 'languages')

when using bun, is bun supported?
Solution:
sorry, I needed to reinstate node_modules after moving to bun

Mutex

If I use mutex in sapphire message commands, will it work fine?

Reaction listener not working for additions, only removals

I am testing a reaction listener for my bot and it is only triggering when a reaction is removed, and not when a reaction is added. The bot has the correct intents and partials. ```ts intents: [ GatewayIntentBits.DirectMessages, GatewayIntentBits.GuildMessages,...

Did something change about what gets logged on bot initialization?

I'm using SapphireClient's built-in logger with @sapphire/plugin-logger. I used to get logs like the ones in the first image, but now I'm getting only 2 lines logged, as shown in the second. I should also mention that the logs from the first image are from a sharded application, while the second are not. Would that be the reason?...
Solution:
I've managed to solve the problem, for anyone else running into the same thing: I've noticed that pieces weren't getting loaded either and found out that it's not finding my "base user directory" because the "main" property in my package.json points to dist/sharding_manager/index.js but my piece directories are under dist/shard. You can use the baseUserDirectory option when instantiating the SapphireClient to point to the correct directory. In my case it was set to dist/shard....
No description

Result/Option infer any type when map.

I've been using the Result lib for some time, and its api it's really great, but the type inference has become a bit difficult when mapping over Result/option objects. I've noticed that the any type is spreading because the Err<E, T = any> and in the map definition don't pass the OutputValue to the Err type. Is there a reason for that? If I made this change, I would get the correct type inference....
No description

Scheduled Task retry failed job

I want to make it so that if there’s an error when running the delayed task, it gets delayed according to a backoff strategy. However, in the current code of the library, this isn’t possible because of code in run method of ScheduledTaskHandler. Is there any way to fix this? corresponding line that blocks re-trying failed jobs: upd. maybe not that line, I don’t know exactly what the methods of Result do...
Solution:
merged. Will release when CI is done then post to #Announcements

Delete Global Commands

2025-09-13 16:26:16 - DEBUG - ApplicationCommandRegistry[ping] Registering id "1416565441790476369" to internal chat input map
2025-09-13 16:26:16 - DEBUG - ApplicationCommandRegistry[ping] Registering id "1416565441790476371" to internal context menu map
2025-09-13 16:26:16 - DEBUG - ApplicationCommandRegistry[ping] Registering id "1416565441790476372" to internal context menu map
2025-09-13 16:26:16 - DEBUG - ApplicationCommandRegistry[ping] Registering id "1416565441790476369" to internal chat input map
2025-09-13 16:26:16 - DEBUG - ApplicationCommandRegistry[ping] Registering id "1416565441790476371" to internal context menu map
2025-09-13 16:26:16 - DEBUG - ApplicationCommandRegistry[ping] Registering id "1416565441790476372" to internal context menu map
How can I remove all of them? ...

MessagePrompter does not collect response

I've created a messageprompter like so: ```ts import { MessagePrompter } from '@sapphire/discord.js-utilities'; // channel is acquired (dm channel), interaction user is acquired...
Solution:
I forgot to add the gateway intent bit for direct messages, oops

Is sapphire compatible with "Running TypeScript Natively"

I'm trying to use this feature of nodeJS but sapphire don't seem to be compatible https://nodejs.org/en/learn/typescript/run-natively...

text command triggered by mentioning

For some context, I noticed that someone else had asked a similar question here, and the answer to that question was to add a listener called mentionPrefixOnly. What I am looking for is something similar. I am building an AI bot, and I want my users to be able to reply to a message and say something like "@Bot, is this true?" How can I get this to work?
Solution:
This worked perfectly, just for search purposes the correct event is UnknownMessageCommand

clean/sanitise strings

hey, quick question, is there a function in @sapphire/utilties that cleans strings from stuff likw ZWSs and other stuff?
Solution:
alright thank you

Prisma with Sapphire

Hello, im new to sapphire framework.. but i have question why it does not work? ``` import "dotenv/config"; import { container, SapphireClient } from "@sapphire/framework";...

Is there an example of Tsdown for sapphire?

Is there an example of use instead of tsup, with tsdown also using the esm?

Best way to learn sapphire

Hello, im comming from another framwork.. that is the best way to learn sapphire are there youtube tutorials or just the docs?
Solution:
docs yeah. there's some vids but they're not official so idk how their quality is

registerApplicationCommands Naming Convention for ContextMenu Command

Hey there, I was just seeing if Sapphire makes the Name of the Command Lower Case when its a User Context Command as even when I put "Report User" in the name of the command it comes through as "report user" When Discord Supports Spaces and Uppercase for User Context Commands ```js...
Solution:
Seems like it was a Discord Caching Issue, just had to remove the bot and re-add it.
No description
Next