sapphire-support
discordjs-support
old-sapphire-support
old-discordjs-support
old-application-commands-and-interactions
Sapphire-like Listeners for other Emitters, such as ShardManager?
shardCreate
event of ShardManager
.
Sapphire makes event handling so simple, so I figured I'd hope that there is, instead of going manual....scheduled tasks plugin compatibility
Event before interaction handlers are ran
ChatInputCommandRun
and ContextMenuCommandRun
events, which are emitted before the run method. Is there anything similar for interaction handlers which is emitted after parse but before run?How do I handle this UserError?
How to transform array with shapeshift using default values?
``ts
const bans = JSON.parse(data);
const defaultReason =
Imported by ${interaction.user.username} from ${link}`;...Slash Commands
Multiple Button Handlers, only 1 takes in a request
interaction-handlers
directory.
src/interaction-handlers/operation.ts
```ts
import {...Add Choices To An Already Registered Command
Creating a button handler
New to Sapphire! Where should I start?
sending html using api plugin
text/html
using the api plugin?
I would like to expose a small landing page for an external oauth flow....``ts
response
// @ts-expect-error This should be Mimetypes enum but it currently doesn't have
text/html`
.setContentType('text/html')
.status(HttpCodes.OK)...Validate arguments without triggering cooldown
Set precondition's name instead of having it resolve from file name
Should I create multiple interaction handlers for each interaction type?
parse
method is to determine whether a specific interaction handler should run, so that means we can create multiple handlers of the same type (Button for example) right?
The guide does mention this is possible for listeners but doesn't say anything about it for interaction handlers so I just wanted to confirm, thanks!...Passing down arguments of Commands to the Interaction Handlers
/clan member @MindLabor
and this command creates a message with Buttons. I also have a button interaction handler which runs when the button is clicked. But in that interaction handler I cannot find the arguments of my original command that created the message. Is there a good way of "passing" the data from where the buttons are built to the handler?
Button Message Creation:
```ts
return interaction.reply({...unique-label
, then I can checke if the user who clicked the button matches the user who requested the button, and finally I get whatever other information I need to actually preform the action (in your case that looks like it owuld be another userID)Node Heap Allocation Issue
pnpm update
. I guess some lib was outdated with that bugTriggering a Modal, Message With Buttons, ...
Passing down from the index.ts and arguments to subcommands