sapphire-support
discordjs-support
old-sapphire-support
old-discordjs-support
old-application-commands-and-interactions
TS Issue
installed freshly using sapphire new
Solution:
This will be fixed in a future version of sapphire. The issue is known.

Slash-Context menu commands with spaces?
Is there any way to create a slash command without dashes like "User Info" or something like it? Haven't tested yet but I want to know, and also if the uppercase will appear as well.
Solution:
Error compile
Is anyone know what causing this? i tried to re-install the package but still same when trying to build TS

Same command files but in different folders
So is sapphire like going to function well if I were for example have kick.js twice but one in admin folder and one in developer folder? Both set to deploy to different guilds?
Solution:
- department/kick.js
-
name: 'department/kick'
- developer/kick.js
- name: 'developer/kick'
...Manual Scheduled Task not found
I try to manually schedule a task
...
const payload = { awesome: true };
await container.tasks.create({ name: 'rememberMe', payload }, 5000);
const payload = { awesome: true };
await container.tasks.create({ name: 'rememberMe', payload }, 5000);
Solution:
Then the name is RememberTask. By default sapphire will use the file name as the name of the piece. Either you have to specify a different name in the constructor or rename the file. The module augmentation that you do at the bottom is typescript only, and doesn't affect runtime.
Manual Scheduled Task Method Arg Number mismatch with documentation
It's pretty simple:
Documentation fo ScheduledTasks plugin says
container.tasks.create
has 3 arguments as stated in the github readme (https://github.com/sapphiredev/plugins/tree/main/packages/scheduled-tasks):
- task – The task to be scheduled.
- payload – The payload for the task....Solution:
https://github.com/sapphiredev/plugins/pull/623 :WAHHHHHHHHHHHHH:
messageCommandDenied preventing bot from booting
Hello, I'm using the basic messageCommandDenied code provided in the sapphire docs and it has been working up until today but upon booting up one of my bots I get the following error:
```src/listeners/messageCommandDenied.ts:15:27 - error TS2339: Property 'send' does not exist on type 'DMChannel | PartialDMChannel | PartialGroupDMChannel | NewsChannel | StageChannel | TextChannel | PublicThreadChannel<...> | PrivateThreadChannel | VoiceChannel'.
Property 'send' does not exist on type 'PartialGroupDMChannel'.
...
sapphire problem with types
I decided to update packages and now I'm getting those errors (img 1)
Typescript version 5.6.2
Versions for all sapphire packages that I have are visible on screenshot...
Solution:
Downgrade to ~5.4.5
Mind that tilde. It's important.
5.5 and above require a merge of https://github.com/DefinitelyTyped/DefinitelyTyped/pull/69997...

User App
Hey, does sapphire support user installable applications? And if yes, is there any guide or is it just pretty much the same?
Solution:
not yet. DiscordJS released user apps only a few days ago. A sapphire update hasnt been released yet. If you claim "ping me for announcements" through <id:customize> you will know when we post about it in #Announcements
Support for bun
Does sapphire support bun out of the box? While trying to run the code (without compiling, aka directly through bun) I get multiple errors saying a compatible class export can't be found... I'm assuming this means the code has to be compiled first but If I'm wrong let me know.
TypeError: Cannot convert undefined or null to object
I get this error after trying to run my build (Typescript) - it only happened when I updated my typescript package to 5.5.4
```
C:\Users\Lemons\Documents\GitHub\Pixie-beta(typescript)\node_modules@sapphire\shapeshift\dist\cjs\index.cjs:2765
this.enumKeys = Object.keys(enumShape).filter((key) => {
^...
Complete Temlate Error
Created a new Project via CLI (used the complete template) didnt chagned anything and cant run the project now, becuase of this error:
```
src/listeners/mentionPrefixOnly.ts:8:26 - error TS2339: Property 'send' does not exist on type 'DMChannel | ...'
Property 'send' does not exist on type 'PartialGroupDMChannel'....

Discordjs and TypeScript typescript error
Hello, someone else has this same failure, all the embeds in the send section are failing, the bot was working fine until a few hours ago.

serialize a bigint Plugins
```
2024-09-03 11:22:15 - FATAL - TypeError: Do not know how to serialize a BigInt
2024-09-03 11:22:15 - FATAL - at JSON.stringify (<anonymous>)
2024-09-03 11:22:15 - FATAL - at _ApiResponse.json (/home/x/SwBot/node_modules/@sapphire/plugin-api/dist/cjs/lib/structures/api/ApiResponse.cjs:101:75)
2024-09-03 11:22:15 - FATAL - at [HTTP-GET] (/home/x/SwBot/dist/routes/answers.js:20:25)...
Overriding message command listeners
Is it possible to virtually load a piece (listener) to override the default CorePreMessageParser? I'd prefer not to do this by adding it to my listeners folder but rather in my command manager
Fetch not calling JSON.stringify for body objects.
Hey, i'm currently using
@sapphire/fetch
and trying to send a POST request for a API with a object on the body. The thing is: the object is not being stringified and the API is receiving [object Object]
.
I went through the @sapphire/fetch
source code and, apparently, the function that determines if a body should be stringified or not (shouldJsonStringify
) is returning false
for my object. (https://github.com/sapphiredev/utilities/blob/main/packages/fetch/src/lib/fetch.ts#L191-L208)
And just to make it clear, the object that i'm trying to send is in fact...a object, because using typeof theObject
returns object
lol, but its doesn't have a toJSON
function or a Object constructor, in fact it has a [Function: Object]
constructor, which is not included in the shouldJsonStringify
function....preconditions implementation
So i have some preconditions that check the database if the user is a staff or something.
but each of them fetch the database, and it's useless to do 3 requests for the same data can i somehow specify some data to the precondition or is there a way like i fetch the data on the interaction run the run the preconditions?...
File Names
So I was told to ask this here; I am working on a slash command that is supposed to have the same name in multiple guilds but perform different functions, can I use the same name for the file names if they are in different folders for different guilds or? Hopefully that's understandable what i'm trying to ask. I have made a similar question before but this one is about whether the names can be the same of the files.
Solution:
yes, but you'll have to set the
name
property in the options in the constructor / ApplyOptions. Furthermore, you will either have to use bulk overwrite or be very sure that you're tracking idHints otherwise you'll get name clashes when Sapphire attempts to do a comparison analysis to check for new data