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

string option, support for strings inside quotes?

Feel a bit silly making a thread out of this as it's a question rather than a support topic I have read that using args.pick("string") will match the next singular word, or the phrase contained "within quotes". I gather that options and flags are generally used for numerical or bool like inputs, but when reading the value of a flag, it does not behave the same way. ...

eslint-config error: cannot access C: due to not declared in deps (Yarn v3 PnP)

Full error: Error: synckit tried to access "C:, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound....

contextMenuRun not firing

Unsure where to look or what's wrong, I had this command working a month or so ago. The registration happens fine, and I can see the command (and see it updated), but the interaction itself just times out. ```ts @ApplyOptions<CommandOptions>({...
No description

Using args functionality on another message

Hello, I want to use the Args.pickResult() function on another message. Is there any way I can do this? For example, making an args object for that message?

Unknown interaction with paginated message custom actions

Hi there, I'm using sapphire's paginated messages from @sapphire/discord.js-utilities. Before adding custom actions, a stop button worked fine. I recently set custom actions to: ```ts...

Interaction and Message Function Preconditions

Hey! Is it possible to create function preconditions for both interactions and messages under the same exported decorator? Or do I have create different exports for each of them? Alternatively, would I be able to create such function precondition that accepts both messages and interactions?...
Solution:
Sure, just make sure your function takes an argument that can be both types and determine which it is by using an instanceof check

preconditions don't run

I have a precondition (src/preconditions/Setup.ts) being used in a subcommand command (src/commands/setup.ts) and neither the command nor precondition run. I've added debug console.log's to both, and neither output whenever I use the command. I can provide a project .zip in DMs upon request....

Deleting Buttons

Hello, I have a chat input command which sends a confirmation embed (this contains a confirm and deny button), which this is part of the ChatInputCommandInteraction I have the confirm button handler in my "interaction-handlers" directory which handles the button click. On the button click, I want to delete the action row from the ChatInputCommandInteraction, however, I only have access to the ButtonInteraction within the button handler which is a separate interaction....

error

anyone know why im getting this
No description

Paginated Message Replies Only to Interactions?

When I use a paginated message from @sapphire/discord.js-utilities with an interaction and call the run method it replies to the original interaction. However when I follow the same process with a message object it does not reply to the original message. I was wondering if this is perhaps an intents issue or the like but having given the bot all intents and scoured the docs I still can't find a solution. Any help would be much appreciated.

Easy way to add per command permissions/restrictions

Is there an easy way to add a restriction for any command so that it can only be ran by a member with a specific role or in a specific channel. i know you have to integrate it into your database but what the easiest way to set this up. ive been trying to set this up with a precondition for all commands where it checks the command name and checks the database to see if there are any restrictions in place

changing directories

Hey, I'd like to change the directories where routes and interaction handlers are stored, as the default names don't suit my codebase. I've tried changing them in .sapphirerc.json but with no success. Anything else I could try or there is no way of changing them?

editable commands

Is there anyway i can make it so that when someone edits the command it edits the original response and not send a new message everytime?

Message Context Menu Command Not Registering

I am attempting to create a command that shows up when selecting a message. The command code (in src/commands) is: ```ts import { Command } from '@sapphire/framework';...

Remove application commands

How can I remove application commands? I don't see them in the chat with / but I still see them in integrations.

How to declare the BulkOverwrite property in JavaScript?

I've been having trouble trying to find out how to declare the BulkOverwrite option for Sapphire, searched around but couldn't find anything for my use case.

Shapeshift: Type instantiation is excessively deep and possibly infinite

```ts s.object({ filteredWords: s.string .lengthLessThanOrEqual(32) .array.lengthLessThanOrEqual(50),...
No description

Can't run sapphire using bun

using templates from official repo

Augmenting Container Failed

```ts declare module '@sapphire/pieces' { interface Container { db: PrismaClient;...
Solution:
Run yarn dedupe