How can I add my own options to command like permissionLevel?

^
21 Replies
čamdžić
čamdžićOP5mo ago
Is it just extending Command class?
MAROW
MAROW5mo ago
OK Any progress yet?
čamdžić
čamdžićOP5mo ago
But then, in messageCommandError command parameter is MessageCommand type so is there any way I can make it fully type safe right way
MAROW
MAROW5mo ago
Create a ticket and direct your issues directly to the support team above for adequate guidance and support mate @čamdžić
Ben
Ben5mo ago
@Boomeravna not sure what that is but it doesn’t look legit to my eyes
čamdžić
čamdžićOP5mo ago
Scam But I didn't wanted to ping favna
Favna
Favna5mo ago
s!ban @MAROW --days=7 scam bot
Skyra
Skyra5mo ago
:greenTick: Created case 174 | @marow235. With the reason of: scam bot
Favna
Favna5mo ago
always ping staff for scam bots 😉
čamdžić
čamdžićOP5mo ago
@Boomeravna any way you could help me this ? ^
Favna
Favna5mo ago
1. extend class 1. (optional): add module augmention if you need the properly to be available in command store gets 2. use extended class 3. ?? 4. profit https://github.com/skyra-project/skyra/blob/main/src/lib/structures/commands/SkyraCommand.ts
GitHub
skyra/src/lib/structures/commands/SkyraCommand.ts at main · skyra-...
A multipurpose Discord Bot designed to carry out most of your server's needs with great performance and stability. - skyra-project/skyra
čamdžić
čamdžićOP5mo ago
Wdym by this: (optional): add module augmention if you need the properly to be available in command store gets
Spinel
Spinel5mo ago
If you're adding custom properties to your Client class and you want them to be accessible when accessing the client through something like this.container.client you'll have to add module augmentation: https://gist.github.com/Favna/26ed5b2df82d424203b71b9ffbce85c4 For more information on module augmentation see: https://www.typescriptlang.org/docs/handbook/declaration-merging.html
čamdžić
čamdžićOP5mo ago
yea but what do I augment Command with my custom command ?
Favna
Favna5mo ago
if you dont need it dont worry about it
čamdžić
čamdžićOP5mo ago
well I kinda need it in help command I fetch everything from store and I check is hidden property true but in store it would still be Command from sapphire
Favna
Favna5mo ago
do you even need a help command? slash commands have lots of description space already
čamdžić
čamdžićOP5mo ago
I use message commands so yea I need it :/
Favna
Favna5mo ago
ew but ok.
declare module '@sapphire/framework' {

interface Command {
hidden: boolean
}
declare module '@sapphire/framework' {

interface Command {
hidden: boolean
}
čamdžić
čamdžićOP5mo ago
hmm shouldnt it be Command.Options xd
Favna
Favna5mo ago
idk that's on you to specify

Did you find this page helpful?