Roles

Learn more about how to manage roles on other users with the Roles module.

SajuukBot will be ceasing operations on March 31st 2024, due to a variety of factors. For more information, please refer to the announcement provided on the SajuukBot discord server and your options for migrating to a new bot.

The roles module provides an intuitive, risk-free way, of allowing moderators to add and remove roles from other users. It removes the risk of giving the moderators the "Manage Roles" discord perm, which allows the creating, updating and deleting of any role below their highest one, which could lead to issues if the only reason you've given them the permission is to add roles.

Configuration

This section of configuration is a root key, which means it should not be indented and in line with the basic settings like levels, prefix and the like. Please see the full basic configuration for more details on how it should be formatted.

roles:
  enabled: false
  commands:
    add:
      enabled: false
      level: 50
    remove:
      enabled: false
      level: 50
    list:
      enabled: false
      level: 100
    temprole:
      enabled: false
      level: 100

Settings

Each tab contains more details on each setting described in the configuration above.

For more information relating to the commands key, please go to the Commands section below.

SettingDescription

enabled

Toggles the roles module on and off. If this is disabled, then none of the command-based roles functionality is available.

Commands

Due to space constraints, the required syntax of commands, and an example of how they work, are given provided after the list of commands and explanations.

Every command follows the exact same formatting:

  • A key called enabled determining if the command is enabled or not.

  • A key called level, determining the minimum level required to use the command

At the root of the roles key is an enabled key, which globally controls the commands assigned to this module. If the root key is false, then no command will operate, regardless of whether an individual command is enabled.

There are a couple of commands that are part of the !role group. They are noted in the table as required.

CommandDescription

!role add

Adds one or more roles to the given member.

An optional reason can be given for the role changes. Simply add -r REASON at the end and replace REASON with the actual reason.

!role remove

Removes one or more roles from the given members.

An optional reason can be given for the role changes. Simply add -r REASON at the end and replace REASON with the actual reason.

!roles

Lists all the roles in the server. If self-assign roles are enabled and

this is used by a non-moderator, it will only list publicly assignable

roles.

!role info

Shows information about the given role, like the number of members, its colour and known permissions.

!temprole

Adds one ore more roles to the user which will be removed after the defined time period. This is useful for where you might want to give "reward" roles from giveaways for example, automating the process of having them be removed later.

When this is used by a moderator, an optional reason can be given for the role changes. Simply add -r REASON at the end and replace

REASON with the actual reason.

!temprole modify

Modifies the expiry time of any temporary roles given to the user. The new time of expiring roles is taken from when they were originally applied to the user.

!temprole expire

Expires any temporary roles given to the user there and then. This

is useful if they've been given the role for too long and you cannot

modify their expiry time (due to your new defined time being in the

past).

Syntax and Examples

Below are the syntax requirements of the above commands, along with an example to show how it works.

SyntaxExamples

!role add MEMBER LIST,OF,ROLES,TO,ADD -r OPTIONAL REASON HERE

!role add @SajuukBot#2980 My Role,Another Role !role add @SajuukBot#2980 My Role,Another Role -r My Optional Reason !role add 745027059042091019 My Role,Another Role !role add 745027059042091019 My Role,Another Role -r My Optional Reason

!role remove MEMBER LIST,OF,ROLES,TO,REMOVE -R OPTIONAL REASON HERE

!role remove @SajuukBot#2980 My Role,Another Role !role remove @SajuukBot#2980 My Role,Another Role -r My Optional Reason !role remove 745027059042091019 My Role,Another Role !role remove 745027059042091019 My Role,Another Role -r My Optional Reason

!roles

No arguments.

!role info

!role info bot !role info 315957200142991360

!temprole MEMBER TIMESTAMP LIST,OF,ROLES -r OPTIONAL REASON HERE

!temprole @SajuukBot#2980 1d My Role,Another Role !temprole @SajuukBot#2980 1d My Role,Another Role -r My Optional Reason !temprole 161815653387468800 1d My Role,Another Role !temprole 161815653387468800 1d My Role,Another Role -r My Optional Reason

!temprole modify MEMBER TIMESTAMP

!temprole modify @SajuukBot#2980 3d !temprole modify 161815653387468800 3d

!temprole expire MEMBER

!temprole expire @SajuukBot#2980 !temprole expire 161815653387468800

Last updated