commands
Is there any way to ignore a command inside the commands folder ?!
i have an abstract class that extend Command !
but i do not want to set the abstract class as command , only the child classes that extends the abstract class
13 Replies
are you declaring the class inside the commands folder?
yes !!
why
move the declaration of the abstract class into a different folder
and it should be fine
maybe a lib folder
but i need the child classes that extend from that abstract class , to be commands
if the abstract class extends the base Command class
its gonna work
yeah it will , but it will also consider that abstract as command, and i do not want that
what
have u tested this?
or are u just speculating
i tested it
That 100% should work as I am doing the same thing with my bot. Can you send your file stucture
i think you didn't understand me
one sec
I have an abstract class called BaseSelfRoleCommand.
The BaseSelfRoleCommand extend the Command.
And i have two class ColorCommand and GenderCommand , both this classes extends BaseSelfRoleCommand
and all this class are inside commands .
the problem is , that sapphire create 3 commands , instead of just 2 (color,gender)
so if i send !!color , or !! gender , it works (!! is my prefix bot)
but the problem is when i also send !!baseselfrole , it also works , wich have no meaning to set it as a command
Solution
move BaseSelfRoleCommand out of the commands folder
Thanks a lot , it worked !!
now i feel dump
For the reference of others, the file layout should look like this.