NadekoBot/docs/Permissions System.md

82 lines
4.2 KiB
Markdown
Raw Normal View History

2016-10-09 19:59:20 +00:00
Permissions Overview
===================
Have you ever felt confused or even overwhelmed when trying to set Nadeko's permissions? In this guide we will be explaining how to use the
2017-09-29 11:23:44 +00:00
permission commands correctly and even cover a few common questions! Every command we discuss here can be found in the [Commands List](http://nadekobot.readthedocs.io/en/latest/Commands%20List/#permissions).
2016-10-09 19:59:20 +00:00
Why do we use the Permissions Commands?
------------------------------
2016-10-16 21:40:55 +00:00
Permissions are very handy at setting who can use what commands in a server. By default, the NSFW module is blocked, but nothing else is. If something is a bot owner only command, it can only be ran by the bot owner, the person who is running the bot, or has their ID in [`credentials.json`](http://nadekobot.readthedocs.io/en/1.0/JSON%20Explanations/ "Setting up your credentials").
2016-10-09 19:59:20 +00:00
2016-10-16 21:40:55 +00:00
The Administration module still requires that you have the correct permissions on Discord to be able to use these commands, so for users to be able to use commands like `.kick` and `.prune`, they need kick and mange messages permissions respectively.
2016-10-09 19:59:20 +00:00
With the permissions system it possible to restrict who can skip the current song, pick NadekoFlowers or use the NSFW module.
First Time Setup
------------------
2017-09-29 11:23:44 +00:00
To change permissions you **must** meet the following requirements:
2016-10-09 19:59:20 +00:00
2017-09-29 11:23:44 +00:00
**Be the owner of the server.**
**If you are NOT the server owner, get the role specified by `.permrole` (By default, this is Nadeko).**
2016-10-09 19:59:20 +00:00
2016-10-16 21:40:55 +00:00
If you have an existing role called `Nadeko` but can't assign it to yourself, create a new role called `Nadeko` and assign that to yourself.
2017-09-29 11:23:44 +00:00
![img0](https://i.imgur.com/5QKZqqy.gif)
2016-10-09 19:59:20 +00:00
If you would like to set a different role, such as `Admins`, to be the role required to edit permissions, do `.permrole Admins` (you must have the current permission role to be able to do this).
2016-10-09 19:59:20 +00:00
Basics & Hierarchy
-----
2017-09-29 11:23:44 +00:00
The [Commands List](http://nadekobot.readthedocs.io/en/latest/Commands%20List/#permissions) is a great resource which lists **all** the available commands, however we'll go over a few commands here.
2016-10-09 19:59:20 +00:00
Firstly, let's explain how the permissions system works - It's simple once you figure out how each command works!
The permissions system works as a chain, everytime a command is used, the permissions chain is checked. Starting from the top of the chain, the command is compared to a rule, if it isn't either allowed or disallowed by that rule it proceeds to check the next rule all the way till it reaches the bottom rule, which allows all commands.
To view this permissions chain, do `.listperms`, with the top of the chain being rule number 1, shown at the top of the message.
2016-10-09 19:59:20 +00:00
If you want to remove a permission from the chain of permissions, do `.removeperm X` to remove rule number X and similarly, do `.moveperm X Y` to move rule number X to number Y (moving, not swapping!).
2016-10-09 19:59:20 +00:00
As an example, if you wanted to enable NSFW for a certain role, say "Lewd", you could do `.rolemdl NSFW enable Lewd`.
2017-09-29 11:23:44 +00:00
This adds the rule to the top of the permissions chain so even if the default `.sm NSFW disable` rule exists, the "Lewd" role will be able to use the NSFW module.
2016-10-09 19:59:20 +00:00
If you want the bot to notify users why they can't use a command or module, use `.verbose true` and Nadeko will tell you what rule is preventing the command.
2016-10-09 19:59:20 +00:00
Commonly Asked Questions
---------------
###How do I create a music DJ?
2017-01-03 20:01:22 +00:00
To allow users to only see the current song and have a DJ role for queuing follow these steps:
2016-10-09 19:59:20 +00:00
1. `.sm Music disable`
2016-10-09 19:59:20 +00:00
* Disables music commands for everybody
2017-08-30 17:56:44 +00:00
2. `.sc .nowplaying enable`
2016-10-09 19:59:20 +00:00
* Enables the "nowplaying" command for everyone
2017-08-30 17:56:44 +00:00
3. `.sc .listqueue enable`
2016-10-09 19:59:20 +00:00
* Enables the "listqueue" command for everyone
4. `.rm Music enable DJ`
2016-10-09 19:59:20 +00:00
2017-01-03 20:01:22 +00:00
* Enables all music commands only for the DJ role
2016-10-09 19:59:20 +00:00
###How do I create a NSFW channel?
Say you want to only enable NSFW commands in the #NSFW channel, just do the following two steps.
1. `.sm NSFW disable`
2016-10-09 19:59:20 +00:00
* Disables the NSFW module from being used
2. `.cm NSFW enable #NSFW`
2016-10-09 19:59:20 +00:00
* Enables the NSFW module for use in the #NSFW channel
###I've broken permissions and am stuck, can I reset permissions?
Yes, there is a way, in one easy command!
1. `.resetperms`
* This resets the permission chain back to default, with only NSFW disabled
2016-10-09 19:59:20 +00:00
_-- Thanks to @applemac for providing the template for this guide_