Running commands manually

Is there a way to run commands manually, without a message/interaction making Sapphire do it?
Solution:
Example ``ts // or, if in a command class, just use this.store` const commands = container.stores.get('commands');...
Jump to solution
7 Replies
Favna
Favna•17mo ago
Get it from the store and call the appropriate run command with the appropriate arguments
Solution
Lioness100
Lioness100•17mo ago
Example
// or, if in a command class, just use `this.store`
const commands = container.stores.get('commands');
const command = commands.get('commandName');

await command.interactionRun(/* insert interaction */);
// or, if in a command class, just use `this.store`
const commands = container.stores.get('commands');
const command = commands.get('commandName');

await command.interactionRun(/* insert interaction */);
oriel beck
oriel beckOP•17mo ago
I hoped there is a better way
b1nzee
b1nzee•17mo ago
What better way was you hoping for? I mean, you can always extend sapphire / DJS classes for your own preferred methods 🤷
oriel beck
oriel beckOP•17mo ago
Being able to access the way sapphire runs them (going through preconditions etc)
Favna
Favna•17mo ago
i mean you ccan do that too, you just need to look at the sapphire code and copy it https://github.com/sapphiredev/framework/blob/main/src/listeners/application-commands/chat-input/CorePreChatInputCommandRun.ts
oriel beck
oriel beckOP•17mo ago
Oooh that's what I was looking for, thank you I need the messageRun, but it's probably the exact same thing
Want results from more Discord servers?
Add your server