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

"There are no more arguments." using args.pick('integer')

In this particular case I am trying to check if there is any argument after the command (while my method does work) I get an error saying "there are no more arguments" on value ```js let value = await args.pick('integer').catch((err) => console.log('Volume ::', err.message)); ...

Blacklist Command

I made a command where it adds the user id of the provided user to a db, I wanted to know if there is a feature in Sapphire where it will prevent users from running commands if a certain condition is met so I can implement something like this, I first thought of adding a check in every precondition but im guessing there is a way better way to do this

Precondition issue

. I have this code, but for some reason it deletes the message even if the member has any of the roles in the array...

messageCreate issue

```js const { Listener } = require("@sapphire/framework"); class messageCreateListener extends Listener { constructor(context, options) {...

Listeners question

Will listeners work even if I put them inside of a folder inside the listener folder so it's more organized?

"Maximum number of application commands reached" but hitting the API returns an empty array?

I realized I was setting up global commands when developing my bot and have recently switched to using guild commands instead. However, when I run my bot locally I get an error message along these lines: Failed to overwrite global application commands DiscordAPIError[30032]: Maximum number of application commands reached (5). So I went through the process of deleting all the global application commands by hitting /applications/{application.id}/commands and copying down the ids of each command, then hitting /applications/{application.id}/commands/{command.id}. However, I'm still seeing the "Failed to overwrite global application commands" message when starting my bot. I double-checked /applications/{application.id}/commands and it's returning an empty array so I don't have any global application commands according to the API, and I know that I don't have 5 context menu commands (I counted them, it's 3 actually) so I'm not sure what exactly it's complaining about? I've attached guildIds options to each of my commands so I feel like that can't be the issue? I feel like I'm missing something but I'm not sure what it could be....

Post examples

Hi, sorry if this isn't the correct place to ask this question but I am getting zero results (that I can understand) to answer my query. Is there a library somewhere with other peoples posts that we can copy and use ourselves?

Loader Error

Just why i am getting this ?
No description

How do I check if the user ID is actually equals to the user ID in interaction-handlers

Is there a way to check if the user ID that clicked the button is equals to the user that ran the command? For example: if (interaction.user.id !== <command_user>.user.id)

Button handler is not calling parse method

I have a button, it was working but it stopped for some reason on @sapphire/framework@4.5.1 Code ```ts @ApplyOptions<InteractionHandler.Options>({...

Did the latest @sapphire/plugin-i18next@5.0.5 update break things?

Super preliminary stuff because I haven't bothered to debug it thoroughly; It seems like the plugin doesn't import in my logs after running pnpm update. The typings for the i18n entry in SapphireClient also disappeared. Reverting to 5.0.4 seems to fix the issue. Has anyone else encountered this?...

Spaced options with @sapphire/lexure

How do I get options that contains space? I tried add the options with quotes, but it doesn't work. Detailed code: https://runkit.com/zenshibata/sapphire-lexure-test

subcommand name

is there a way to get the name of the subcommand ran?
Solution:
Should be the same? As long as you have access to the interaction object

Registries behaviour

Can I override registries behaviour and register commands only in one guild? im moving from custom handler and don't want get guildId in every command

Async Preconditions

Helloo! It seems that I am unable to create a precondition that is async, whenever I try to write one with async. I get The inferred type of 'chatInputRun' cannot be named without a reference to '.pnpm/@sapphire+result@2.6.4/node_modules/@sapphire/result'. This is likely not portable. A type annotation is necessary. Here is the code in question: ```ts public override async chatInputRun(interaction: Interaction) {...

Subcommand Preconditions Support

I've got the below code to create a command with subcommands and preconditions in ESM JS. My issue is that no matter what I seem to do, and I've had a look on the docs and had a look at the repo Favna linked here https://discord.com/channels/737141877803057244/1143510279024545864/1143541634248740955 , the preconditions on the subcommands never seem to be acknowledged, either in the precondition or the commands args. ```js import { Subcommand } from '@sapphire/plugin-subcommands'; ...

QUESTION

What is the difference between Sapphire Framework and discordjs what is the benefits between both two

Sample implementation of per-subcommand preconditions

Hello! Are there any examples on how would I be able to implement the new feature? And I suppose this supports both interaction and message preconditions? And would this be a better option instead of using precondition decorators? Thank you!

Question about "runIn" preconditions

Hello! According to the docs regarding setting the channel types a command can run in. In theory setting the command's runIn to
// ...
runIn: [CommandOptionsRunTypeEnum.GuildText, CommandOptionsRunTypeEnum.GuildVoice]
// ...
// ...
runIn: [CommandOptionsRunTypeEnum.GuildText, CommandOptionsRunTypeEnum.GuildVoice]
// ...
Should make the command run in both text channels and voice based text channels. However, setting it like this, doesn't allow me to run them to both channel types. What I can do was to only set one channel type in runIn and it'd work for that particular channel type only. How can I make it so that I can allow the command to run in both channel types?...