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
I feel like you just explained the definition of a precondition
xD
Could you elaborate? Why would you add a check in every precondition?
And this guy has thread(s) about preconditions too
You just need one precondition for blacklist then add it to your array of preconditions in a command file
If you're looking for a blacklist precondition, there's a guide page on making a global one
Sapphire Framework
Global preconditions | Sapphire
Sometimes you want a precondition that automatically runs for every command, without having to add it to each command.
ooooh i didn't read the post name
my bad
Anyways, that page should be exactly what you're looking for @_carlos123
for a second I forgot I could add 2 preconditions, ty
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
should I put
position: 1
so it checks it firstThat 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 🙄
lol
can I create the global preconditions in the same folder as the other normal preconditions?
Yeah
alr ty
Even I learnt something from this thread, I didn't actually know global preconditions are a thing
(fyi not that I really care but people tend to use blocklist instead of blacklist these days for inclusive language)
Oh dip
Thanks for letting me know
What even are the origins of that word
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.
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"?
allowlist
Oh dip again