Sapphire - Imagine a framework

SIA

Sapphire - Imagine a framework

Welcome to the Sapphire Discord server! The next-gen object-oriented Discord.js bot framework can be found here.

Join

sapphire-support

discordjs-support

old-sapphire-support

old-discordjs-support

old-application-commands-and-interactions

addStringOption applyLocalizedBuilder

Hey, Is it possible to use localizedBuilder on the choices for addStringOption? ```ts...

why my ping.ts doesnt wanna run after being transpiled?

So my slash command doesnt wanna execute after its been transpiled to js even though after I did run it on ts-node, it worked without any issues. ```ts import { CommandInteraction } from 'discord.js'; import { ApplyOptions } from '@sapphire/decorators'; import { Command } from '@sapphire/framework';...
Solution:
it sounds like your passing it the ts code and not the transpiled js

Using HMR in TS

So I am considering writing a bot in TS, but my question is, since sapphire supports it, how would I go over using it, like, in TS you have to transpile files to js but what after you make updates to the .ts files, will HMR detect it and reload or how does it look?
Solution:
you run tsc with the --watch flag in the terminal

Programmatically creating and deleting repeated scheduled tasks

I’m trying to implement daily reminders for events managed by my bot. I’m creating the repeated task using the create method on container.tasks but I’m having trouble fetching the ID of the task because it does not match the job ID set in customJobOptions. I have a feeling I’m doing something incorrectly, but I was curious if anyone else has had look with the scheduled tasks plugin and creating/deleting repeated tasks?...

How to reload a command or multiple slash commands and get their ids

Does anyone know how to reload multiple commands or a slash command and also get them their ids?

error while handling the command application command registry

Hello. I have encountered a (weird) bug on SlashCommandBuilder. This one works, no ExpectedValidationError > s.instance(V) error. ```ts public override registerApplicationCommands(registry: Command.Registry) {...
Solution:
You'll have to report this to discordjs because this is a shapeshift validation error raised in @discordjs/builders. If they direct you back here because it's @sapphire/shapeshift, tell them that it's code in builders and not shapeshift that causes this.
No description

TS Issue

installed freshly using sapphire new
Solution:
This will be fixed in a future version of sapphire. The issue is known.
No description

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.

Error compile

Is anyone know what causing this? i tried to re-install the package but still same when trying to build TS
No description

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....

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...
No description

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'....
No description