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

^
21 Replies
čamdžić
čamdžićOP2w ago
Is it just extending Command class?
MAROW
MAROW2w ago
OK Any progress yet?
čamdžić
čamdžićOP2w 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
MAROW2w ago
Create a ticket and direct your issues directly to the support team above for adequate guidance and support mate @čamdžić
Ben
Ben2w ago
@Boomeravna not sure what that is but it doesn’t look legit to my eyes
čamdžić
čamdžićOP2w ago
Scam But I didn't wanted to ping favna
Favna
Favna2w ago
s!ban @MAROW --days=7 scam bot
Skyra
Skyra2w ago
:greenTick: Created case 174 | @marow235. With the reason of: scam bot
Favna
Favna2w ago
always ping staff for scam bots 😉
čamdžić
čamdžićOP2w ago
@Boomeravna any way you could help me this ? ^
Favna
Favna2w 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ćOP2w ago
Wdym by this: (optional): add module augmention if you need the properly to be available in command store gets
Spinel
Spinel2w 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ćOP2w ago
yea but what do I augment Command with my custom command ?
Favna
Favna2w ago
if you dont need it dont worry about it
čamdžić
čamdžićOP2w 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
Favna2w ago
do you even need a help command? slash commands have lots of description space already
čamdžić
čamdžićOP2w ago
I use message commands so yea I need it :/
Favna
Favna2w ago
ew but ok.
declare module '@sapphire/framework' {

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

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

Did you find this page helpful?