Rulesets and Discoid
Learn about how powerful rulesets are.
Ever since the dawn of the original Discoid, a dynamic permission system has been highly requested. We have always promised we will eventually release a feature we called “rulesets.” With discoid2, we can finally do such a thing.
Rulesets are literally sets of rules about whether or not a user should be able to run a command. Each rule is designated to a specified command. Rulesets can forbid specific roles from using a command, allow only a specific role to use a command, or completely disable a command in a specific channel.
With the power of rulesets, you could disable potentially annoying commands like \cat or \slots in on-topic discussions like #general. Perhaps you would like to allow Prune to only be run by users with the role “Pruner.” Maybe you want a role that could be given to those with a warning; a consequence could be no fun Discoid commands!
This is all doable with rulesets. Best part is: they’re not too hard!
How do I do that?
Let’s start with the basics. Use the command \ruleset view. This will show you the current ruleset being used by your server.
You’ll notice there’s no ruleset. That’s good.
For this example, make sure you have a channel called #general. Let’s examine the following rule and have Discoid explain it for us:
To add a rule, use \ruleset change. You’ll be prompted to select from the options set, append, and remove. For now, choose append. Discoid will then ask you what you would like to append to the current ruleset. Copy and paste the above bolded rule into the chat. Discoid will ask to confirm this. Confirm by replying with y.
Now that you’ve added the rule, use \ruleset view again. You’ll notice Discoid now explains specifically what this rule does.
Let’s pick apart this rule and see what’s happening:
-  indicate rules. They surround them.
- cat: lets Discoid know which command this rule will target.
- !#general means this command cannot (!) be run in the channel #general.
Pretty simple, right? The basics of rulesets require you to know that ! means not, which is pretty straightforward.
This rule, however, doesn’t show the power of roles. Let’s create a bigger example, combining what we learned earlier with roles. Let’s make a role so that the command slots cannot be run by any normal person, but by only those who have the Slot Enthusiast role. Additionally, slots cannot be run in the #general channel. It looks something like this:
It got longer! No need to worry, for everything you need to know is separated by commas. Add this rule the same way you added the previous one. Let’s view the ruleset now that we have this new rule and see what it looks like.
The view command will list through all of your rules currently active on the server. You can easily remove any of them by choosing remove upon being asked when using \ruleset change. Let’s experiment with this rule now.
For this example, I have given myself my own Slot Enthusiast role, but have not given it to Hallucinater, as seen in the following image:
Behold, the power of rulesets! Let’s explain it again:
- Same rudimentary task of defining a rule with [command: ].
- Same channel exclusion as before.
- !e means not everyone can use this command.
- Deliberately stating the role, slot enthusiast, causes Discoid to see it as a role that should be allowed to use this command.
As a result, we can completely disable specific commands for specific people in specific locations. This feature was highly requested, and is finally here.
If you have further questions regarding rulesets or you have a suggestion for Discoid, contact someone in Discoid Central! We’re always listening.
Happy rulesetting! Wait, is that a thing? It is now!