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

RuiNtD - How to ensure removed application command...

How to ensure removed commands are unregistered?

DelxHQ - Is there anyway I can defer all of my com...

Is there anyway I can defer all of my commands?

Nitsua - Editing a previously ran slash command re...

Editing a previously ran slash command results in an error. ``` Encountered error on chat input command "hello" at path "/workspace/my-sapphire-bot/src/commands/General/hello.js" DiscordAPIError: Invalid Form Body data.allowed_mentions.users[1]: The set already contains this value at RequestHandler.execute (/workspace/my-sapphire-bot/node_modules/.pnpm/[email protected]/node_modules/discord.js/src/rest/RequestHandler.js:350:13)...

willuhmjs - ```jsValidationError s.string Exp...

```js ValidationError > s.string Expected a string primitive Received:...

Nytelife26 - can i use `ApplyOptions` with an app...

can i use @ApplyOptions with an application command, and if so do I still need to use registerChatInputCommand? i'd guess not but thought i'd check...

kaname-png - Why does this interaction option retu...

Why does this interaction option return null?
No description

Somehow registry not registering

@vladdy Bug Report: Code: https://v.gd/Ftwkcz Problem: Help command not being registered Expected outcome: When help command is registered like all other commands it is shown in discord like the other commands and is functional Actual outcome: When help command is registered like all other commands it does not show in discord and cannot be used. Sapphire logs this when using "Debug" logger level: [DEBUG] ApplicationCommandRegistry[help] Preparing to process 0 possible command registrations / updates.... Compared to other commands returning this:```[DEBUG] ApplicationCommandRegistry[clear] Preparing to process 1 possible command registrations / updates......

Notion document feedback, issues, questions and answers

Hello @everyone! Now, before you bring out the pitchforks and the Ping <:cockatiel_angry_ping:637700629866741817>, PandaPingRage and the pepeping I'd like to clarify that this will be the final @everyone (from me) for a long time, as we'll only ping @Ping Me For Announcements for the announcement when this goes live, and no more pings in this channel. Now that I have you all here, it is time for the feature you all have been waiting for so long... Application Commands in Sapphire are officially test ready! And, as usual, I've written a notion document describing everything you need to know about them! Click https://vladfrangu.notion.site/Application-Commands-3d1683f23f0a4fa6b3e682bc8c1cc1b9 to read it, but be prepared, it's quite a long read. ...

Poll Discussion & Answers

1️⃣ → Interaction Handler 2️⃣ → In the command with the same name / id 3️⃣ → Other (please explain in thread)...

Application Command Registry Interface v1

@here Your feedback is required again! We're inching closer and closer to having application commands in Sapphire, but there's still places where polishing is required, and most importantly, your POGYOUPOINT feedback is wanted! As you're hopefully used to already, here's the notion doc with examples: https://vladfrangu.notion.site/Current-code-examples-for-registering-Application-Commands-in-Sapphire-6720eeb8f8be4cfa92292c44f1db9a2c Please note that these are samples. They may change per your feedback, and at the end, I will create a repository showing it off in an actual code base for those that have uncertainties!...

How should you, the end user, define commands?

⚠️ How should you define what application commands are for what command classes, and how should they be registered for you? (SUPER IMPORTANT QUESTION) 1️⃣: Default by the command.name, otherwise command.chatInputName (for chat input commands) or command.contextMenuName for context menus, and provide a utility function on the command store that lets you register them if missing at ready (can go into more details if this option is chosen) 2️⃣: Passing in an array of @discordjs/builders in the command class's options, which get pushed to the API based on client settings (as above, with some options for handling existing commands and what not) 3️⃣: Propose a better solution...

Preconditions with missing handlers! What do?

Preconditions: What should happen with preconditions (global or not) that need to run on a message command but do not have a handler for them? Skip? Throw error?

Context Menus vs Application Commands - separate or not?

Question time ❓ Context menus.. they exist. They're like used once a blue century. How should we handle them in Sapphire? Should the split between application commands and context menus be clear (so a function for each), or should they both be in the same function? (especially since the interface is almost 1:1, past the target for context menus)? Should the same be done for preconditions?...

Interaction Handlers after usage

Want to give interaction handlers a shot now? Well, you can! Just run the command below and give them a shot 😉 npm install @sapphire/framework@pr-293...

Interaction Handlers!!

Hello peeps! I know, I know, allllll of you (myself included) are just basically begging me for application commands in Sapphire (and they're coming, don't you worry 😉), but we have to start slow. For now, I have some proper "documentation" on interaction handlers! 🎉 Are you ready to be HYPED?! (I hope.. please.. I'm trying my best here ;w;)...

Initial Commit Thoughts

I've pushed the initial commit for interaction handlers: heavily wip, totally untested and raw (just how I like it)! https://github.com/sapphiredev/framework/commit/e158f7f0bc9b17f4802f1c9a82abf03dc31c8776 Please take a look at it, leave thoughts (especially you @Developers smh), see what's unclear and what's clear, and list any final thing you'd rather see changed because this interface is nearing it's final state 😋 ...

The statefulness or statelessness of Interactions

1. Most likely, but it would be a nice addition if I was able to have non-state "callbacks" as mentioned in my thread before. I don't fear the restarts being a huge issue and personally I'd like to refrain from jumping back and forth between several code sources to reply to an interaction. 2. For certain things yes, but that's very usecase heavy. As mentioned above. Most of my usecases will usually be immediate replies and not collecting x for some poll or something (in which case I'd have a state). I also think most usecases in general do not have the need to keep state and are easier done by just allowing callbacks after initiating (keeping track of them by a map or something idk)...

Interaction handlers in the command instead of globally

Honestly. I would much rather add interactions from my command and from there tell to continue in (for example) a different function within that command class than have to handle the interaction in a certain "listener" and keep a state of whats what before the interaction.

Reply sess 2

1. Yes. This also follows the design pattern that we more-or-less employ already for Sapphire. We chunk up files so each has their own dedicated purpose and is not muddied by other purposes. We're at least sort of object oriented that way. Furthermore, it being a separate piece means we can also separately use @ApplyOptions and any other decorators we may write in the future. 2. Yes, needed 3. I don't think that's needed but then I haven't written custom IDs before so I'm not sure. 4. I think it's pretty dang useful like this...