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

How to create errors like this

I'm used parse function but It doesn't look like in the photo.

Interaction user locale first

Hello, I would like to get the TFunction from i18next based on the user locale first and not the guild one Is there a way to do this?...

not working

Hi, my bot is not working does anyone know why? index.ts: ```js import { SapphireClient } from '@sapphire/framework';...
Solution:
3. I dont have a main property
you say you following the guide but......

Hybrid commands

Is there something like hybrid command which can be used to create prefix and slash commands and also the execution together like discord.py
Solution:
¯\_(ツ)_/¯

@skyra/env-utilities is not assignable to parameter of type 'never'

I am not sure what to do here https://juan.evaded.tax/i/k6e74.png...
Solution:
it's ArrayString you need, not EnvArray

Error: Request aborted manually

Hi, sorry if the tag is wrong, I'm not really sure what all of them mean. Anyways, I use the @sapphire/async-queue package and I came across an issue where calling the abortAll method led to a "Request aborted manually"-error. Attached is the stack, in case that helps....
Solution:
thats literally what abortAll does

A compatible class export was not found.

When use HMR and edit files It always sends an error, no matter what file is being edited: ```console 9|Wishbot | [ERROR] [HMR-Plugin]: Failed to load pieces from /root/node/Customers/Wishbot/src/commands/collection.js. Error [EMPTY_MODULE]: A compatible class export was not found. [/root/node/Customers/Wishbot/src/commands/collection.js] 9|Wishbot | at LoaderStrategy.load (/root/node/Customers/Wishbot/node_modules/@sapphire/pieces/dist/lib/strategies/LoaderStrategy.js:92:19)...

Is it possible to use discord.js-light with Sapphire?

The title is self-explanatory, I think.
Solution:
If you're asking about if the framework will work, we can't guarantee it because it was not made with discord.js-light in mind. I'm not sure about the best way to make sapphire use it though, forking and overrides both sound like good options

Is Sapph.xyz bot related to this project/community?

Asking because of the name resemblence and i dont seem to find it in the server's bot list - is it in any way related (owner, uses sapphirejs, etc..) or just a name similarity?
Solution:
Completely unrelated. Same goes for the bot that's actually called "sapphire"

Typing the Err generic of Result to be empty

Sorry if this is a basic Typescript question! Is it possible to type a function's output so that I can return Result.err() without any parameters? f.e. ```ts function myFunction(): Result<true, ???> { if (condition) return Result.ok(true) else...

Added new options to slash command; not being reflected on discord

```ts registry.registerChatInputCommand((builder) => builder // .setName(this.name) .setDescription(this.description)...
Solution:
Found out why, error with compiling made there be duplicate files: the old one and the updated one

Handle Crash on DiscordAPIError[50001]: Missing Access

The scenario that causes this crash is the bot tries sending a message to a channel it doesn't have access to. Now I can solve this issue by checking it has permissions before hand or catching directly on the send, but my question is, is there a way to keep the bot from crashing if I miss a check at some other point? I do have an error.ts listener set up but doesn't seem to be making a difference. ``` /Users/x/Work/bot/node_modules/@discordjs/rest/dist/index.js:667 throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData); ^...
Solution:
I figured it out so nvm it's because I wasn't awaiting on my send calls

"dm_permissions: false" dont work

I was trying to make the slash commands not visible in the md but it doesn't work for me, can you tell me why ```typescript export class Channel extends Command { public registerApplicationCommands(registry: ApplicationCommandRegistry){ registry.registerChatInputCommand({...

How do i make an entire array an autocomplete?

I have a huge array and I want it to be autocomplete for a command how would i go about implementing that into a AutocompleteHandler ?
Solution:
first of all, you have to limit it to 25(? i forgot the max) results secondly, you just return the array in the proper order, and you sort it by using a fuzzy searching algorithm such as Jaro Wrinkler (use @Skyra/jaro-wrinkler for example)...

Error when adding a String option

Hey, when using ..addStringOption I get a error of ExpectedValidationError > s.instance(V). It works with adding a user option, but not a string option? ```js .addStringOption(option => {...

[SOLVED] quick question; does sapphire defer replies?

does sapphire defer interaction replies? no sapphire cli just @sapphire/framework
Solution:
ive figured out to just use interaction.deferReply() when needing it, ive only used it for eval so far tho

Invalid Form Body (or at least something like that) When the bot tries to register a new command

Hello, I just started to continue on my bot. I just did a upgrade to the most recent version of discord.js and sapphire. But now, the bot started giving me after "boot" cringe errors telling me that he can't register the commands. Exactly: take a look on the screenshot, this **** ist too long! sapphire-version is "next". I use CommonJS btw, that was a previous error 😅...
Solution:
its most likely to do with the fact that your providing the decorator and constructor. you have to provide one or the other, so you can either: - move your preconditions and cooldownDelay into the the decorator and remove the constructor - move your description into the constructor and remove the decorator...

@sapphire/result error in v4

After migrating to Sapphire v4 and D.js v14 and fixed all breaking changes, I've still got three errors from @sapphire/result One of the error is: ```...
Solution:
Anyway I think the reason for your issue might be that you haven't updated TypeScript, so try updating it to 4.9.4

Slash Command with Subcommand Plugin doesnt registering

After i update sapphire v4 and also djs v14 the commands using subcommand plugin doesnt registering their applicationcommands
Solution:
i reinstall subcommand plugin package and it works normally