Permissions
This is the cog guide for the permissions cog. You'll find detailed docs about usage and commands.
note
[p]
is your prefix
Usage
Customise permissions for commands and cogs.
This cog extends the default permission model of the bot. By default, many commands are restricted based on what the command can do. This cog allows you to refine some of those restrictions. You can allow wider or narrower access to most commands using it. You cannot, however, change the restrictions on owner/developer-only commands.
When additional rules are set using this cog, those rules will be checked prior to checking for the default restrictions of the command. Global rules (set by the owner) are checked first, then rules set for servers. If multiple global or server rules apply to the case, the order they are checked in is:
- Rules about a user.
- Rules about the voice channel a user is in.
- Rules about the text channel a command was issued in.
- Rules about a role the user has (The highest role they have with a rule will be used).
- Rules about the server a user is in (Global rules only).
Commands
permissions
Syntax
[p]permissions
Description
Comaand permission management tools.
permissions acl
danger
This command is locked to the server admins.
Syntax
[p]permissions acl
Description
Manage permissions with YAML files.
note
See here for more information with configuring these yaml files.
permissions acl getserver
danger
This command is locked to the server admins.
Syntax
[p]permissions acl getserver
Description
Get a YAML file detailing all rules in the server.
permissions acl setserver
danger
This command is locked to the server admins.
Syntax
[p]permissions acl setserver
Description
Set rules for the server with a YAML file.
warning
This will override reset all rules in the server to the rules specified in the uploaded file.
permissions acl updateserver
danger
This command is locked to the server admins.
Syntax
[p]permissions acl updateserver
Description
Update rules for the server with a YAML file.
This won't override any rules not specified in the YAML file.
permissions acl yamlexample
Syntax
[p]permissions acl yamlexample
Description
Sends an example of the YAML layout for permissions.
permissions addserverrule
danger
This command is locked to the server admins.
Syntax
[p]permissions addserverrule <allow_or_deny> <cog_or_command> <who_or_what...>
Description
Add a rule to a cog or command in the sevrer.
Arguments
<allow_or_deny>
: This should be one of "allow" or "deny".<cog_or_command>
: The cog or command to add the rule to. This is case sensitive.<who_or_what...>
: One or more users, channels or roles the rule is for.
permissions canrun
Syntax
[p]permissions canrun <user> <command>
Description
Check if a user can run a command.
This will take the current context into account, such as the server and text channel.
Arguments
<user>
: The user to check permissions for.<command>
: The command to check whether the user can run it or not.
permissions clearserverrules
warning
This command is locked to the server admins.
Syntax
[p]permissions clearserverrules
Description
Reset all rules in the server.
permissions explain
Syntax
[p]permissions explain
Description
Explains how permissions work.
permissions removeserverrule
warning
This command is locked to the server admins.
Syntax
[p]permissions removeserverrule <cog_or_command> <who_or_what...>
Description
Remove a server rule for a command or cog.
Arguments
<cog_or_command>
: The cog or command to remove the rule from. This is case sensitive.<who_or_what...>
: One or more users, channels or roles the rule is for.
permissions setdefaultserverrule
warning
This command is locked to the server admins.
Syntax
[p]permissions setdefaultserverrule <allow_or_deny> <cog_or_command>
Description
Set the default rule for a command or a cog in the server.
This is the rule a command will default to when no other rule is found.
Arguments
<allow_or_deny>
: This should be one of "allow" or "deny".<cog_or_command>
: The cog or command to add the rule to. This is case sensitive.