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

Is it possible to use my own LoaderStrategy?

I want to add support for tsx. Currently I've got it working by editing the LoaderStrategy file in node_modules and setting shouldLoadTsFiles to true. Is there a way to do this using sapphire?

Only receiving interactions on local machine

Hi all, The title is quite self explanatory, but a little more detail here. I've been trying to get my bot to work on my production machine but it looks like interactions aren't being received on there. However, when I run the bot on my local machine, the interaction goes through perfectly fine. ...

Subcommands Broken

Hi everyone! I tried using subcommands w/ sapphire for the first time, and now it's just telling me that the interaction is not responding. The bot is online, but it's not responding to said command
Solution:
solved

PaginatedMessage not changing files

For some reason, PaginatedMessage doesn't seem to update the file when the page changes. How do I solve this? My code: ```ts const paginated = new PaginatedMessage(); for (const image of images) {...

Slash Command - The application did not respond - nothing in console.

I've set up a slash command, it appears in discord, but when I run it I get "The application did not respond". The application log doesn't show any activity. This is a shortened version of my command....
Solution:
If you want to use subcommands you need to extend the class Subcommand from @sapphire/plugin-subcommands, not Comand from @sapphire/framework.

unable to generate custom components using @sapphire/cli

.sapphirerc.json ```json { "$schema": "https://raw.githubusercontent.com/sapphiredev/cli/main/templates/schemas/.sapphirerc.scheme.json", "projectLanguage": "ts",...
Solution:
FWIW btw, development on the new version of the CLI has started in #cli-development
No description

optional argument

how to create an optional argument? like if the arg is empty, it uses the author, otherwise, it validates the argument into an user
Solution:
await args.pick('user').catch(() => message.author)
await args.pick('user').catch(() => message.author)
...

error: A compatible class export was not found.

My code ```ts import { InteractionHandler, InteractionHandlerTypes,...
Solution:
My bad they were interaction-handlers and I had them in the folder meant fo listener's

Error [ERR_REQUIRE_ESM]: require() of ES Module

So im getting this errror about 3 times for different packages ```js Error when loading 'commands\Colors\average-colors.js': Error [ERR_REQUIRE_ESM]: require() of ES Module \node_modules\color-thief-ts\dist\browser.js from dist\commands\Colors\average-colors.js not supported. Instead change the require of browser.js in dist\commands\Colors\average-colors.js to a dynamic import() which is available in all CommonJS modules. ...
Solution:
for color-thief-ts, read their readme: https://github.com/wh5938316/color-thief-ts it specifically says you need to import it differently for NodeJS. for mime it specifically says that as of v4 it only supports ES modules at the top of the README, and you're using CommonJS: https://github.com/broofa/mime...

Member cache and tracking members

Hello, I wanted to ask if by default theres any sort of limit or sweeping or such with Sapphire. Secondly I wanted to know if by default any member joining/being removed would accurately be reflected in the member cache without fetching it again. I also noticed that after i do a <Guild>.member.fetch() it returned exactly 10members less than are on the server if I check via Discords member list....
Solution:
wanted to ask if by default theres any sort of limit or sweeping or such with Sapphire.
there is not. This is controlled by discordjs. General rule of thumb is ask yourself: is it related to running commands or handling events? Then yes it's possibly Sapphire related. If not, then it's not....

too much errors

why does all of a sudden my sapphire bot stopped working? its not getting online when i ran dev script but used to work last week. im using ts version
Solution:
downgrade typescript to ~5.4.5, TS 5.5 broke some serious stuff. (btw cc @vladdy )...
No description

Message commands help

Hey I started my journey with sapphire today and can't seem to make message command's work This is my code so far ```ts //index.ts import "@sapphire/plugin-i18next/register";...
Solution:
Okay I fixed it, the problem was indeed very silly I found out the code wasn't running after the canRunInChannel function, I checked what's the function was doing and it was a perms error ```ts async canRunInChannel(message) {...

How do I check if it goes "@sapphire/plugin-api"

How do I check if @sapphire/plugin-api bot api is working properly, I use railway for production
Solution:
add a route and see if you can query it. How that integrates with railway is for you to figure out, support for sapphire does not extend to the hosting platform.

Bun compatibility

So, aparently when installing @sapphire/result and @sapphire/lexure with Bun, they will "install" but with empty folders as shown below.
Tried --force and --save flags on install but none worked....
Solution:
Solved, i upgraded from 1.1.14 to 1.1.15 and it worked
No description

How do I make commands only visible to certain users?

Question's in the title. How do I make (interaction) commands visible to only certain users?
Solution:
use #setDefaultMemberPermissions maybe?

No subcommand was matched with the provided command.

Unable to run any of my settings group commands. Am I setting them up wrong or something? https://pastebin.com/UbS5qrYu...
Solution:
close
No description

Coommands are not registered

I just put my bot in my server, and it does not identify commands anymore. picture of file structure is attached here, please help if you can...
No description