Blacklist Command

I made a command where it adds the user id of the provided user to a db, I wanted to know if there is a feature in Sapphire where it will prevent users from running commands if a certain condition is met so I can implement something like this, I first thought of adding a check in every precondition but im guessing there is a way better way to do this
22 Replies
Lioness100
Lioness100•16mo ago
I feel like you just explained the definition of a precondition
b1nzee
b1nzee•16mo ago
xD
Lioness100
Lioness100•16mo ago
Could you elaborate? Why would you add a check in every precondition?
b1nzee
b1nzee•16mo ago
And this guy has thread(s) about preconditions too You just need one precondition for blacklist OldManShrug then add it to your array of preconditions in a command file
Lioness100
Lioness100•16mo ago
If you're looking for a blacklist precondition, there's a guide page on making a global one
Lioness100
Lioness100•16mo ago
Sapphire Framework
Global preconditions | Sapphire
Sometimes you want a precondition that automatically runs for every command, without having to add it to each command.
Lioness100
Lioness100•16mo ago
ooooh i didn't read the post name my bad Anyways, that page should be exactly what you're looking for @_carlos123
-Carlos👑
-Carlos👑OP•16mo ago
for a second I forgot I could add 2 preconditions, ty
Lioness100
Lioness100•16mo ago
But also, you won't need to, because you can make global preconditions that will automatically be added to every command. Read the guide page
-Carlos👑
-Carlos👑OP•16mo ago
should I put position: 1 so it checks it first
Lioness100
Lioness100•16mo ago
No description
Lioness100
Lioness100•16mo ago
That should work, but I'd do what the guide page is recommending just in case there might be edge cases neither of us considered I'm surprised a magic number like 20 is suggested. What if core preconditions are added/removed? cc favvy wavvy ugh this framework's quality declines day by day 🙄
-Carlos👑
-Carlos👑OP•16mo ago
lol can I create the global preconditions in the same folder as the other normal preconditions?
Lioness100
Lioness100•16mo ago
Yeah
-Carlos👑
-Carlos👑OP•16mo ago
alr ty
b1nzee
b1nzee•16mo ago
Even I learnt something from this thread, I didn't actually know global preconditions are a thing
Favna
Favna•16mo ago
(fyi not that I really care but people tend to use blocklist instead of blacklist these days for inclusive language)
Lioness100
Lioness100•16mo ago
Oh dip Thanks for letting me know What even are the origins of that word
Favna
Favna•16mo ago
Blacklist? It's a totally normal world but you know what the "woke" world is like these days. People think any usage of "black" is racist.
b1nzee
b1nzee•16mo ago
No shot, man I hate this "woke" world Bad enough the nursery rhyme "ba ba black sheep" got changed and now this 🤣 So what about "whitelist"?
Favna
Favna•16mo ago
allowlist
Lioness100
Lioness100•16mo ago
Oh dip again
Want results from more Discord servers?
Add your server