MoonlightBot Documentation
  • MoonlightBot Documentation
  • Get Started
    • Options
    • Frequently Asked Questions
    • Permission Tutorial
    • Moderation Tutorial
    • Setting up Reaction Roles
  • Support Our Work
    • Volunteer Opportunities
    • Premium Subscriptions
    • Upvote MoonlightBot
    • Support Server
    • MoonlightBot Beta (early access)
    • Special Thanks
  • Policies
    • Acceptable Use Policy
    • Volunteer Code of Conduct
    • Privacy Policy
  • Management Commands
    • config
    • create-muterole
    • reaction-roles
  • Miscellaneous Commands
    • check-duration
    • premium
    • userconfig
    • Other Minor Commands
  • Moderation Commands
    • ban
    • clean
    • infractions
    • kick
    • mute
    • softban
    • tempban
    • tempmute
    • timeout
    • unban
    • unmute
    • warn
  • Role management Commands
    • list-temproles
    • pause-role
    • role
    • selfrole
    • temprole
  • Utility Commands
    • reminder
    • serverinfo
    • snowflake
    • userinfo
  • Advanced
    • Using developer mode
    • List of log names
Powered by GitBook
On this page
  • Required permissions
  • Syntax
  • Options
  • Logs
  1. Role management Commands

role

Previouspause-roleNextselfrole

Last updated 6 months ago

This command allows you to assign or remove a role from a user. If the role is already assigned to the user, it will be removed and vice versa.

Note that you can also target users who are currently not on the server. By doing so, it creates/removes a persistence. This will cause the role to be assigned to the user when they join the server.

Required permissions

MoonlightBot requires the following permissions to successfully execute this command:

  • Manage Roles

By default, a user is required to have the following permissions to use this command:

  • Manage Roles

For more information on editing permission requirements for specific users/roles, refer to the

Syntax

/role <user> <role> [reason]

Options

  • user: The user to assign/remove the role to/from

  • role: The role to assign/remove from the user

  • reason: The reason for assigning/removing the role from the user. This is an optional parameter, which can be used for record-keeping

Logs

  • ROLE_ADD: This log is triggered when a role is assigned to a user. It will log the user, the role, the responsible moderator, and the reason for the role assignment.

  • ROLE_REMOVE: This log is triggered when a role is removed from a user. It will log the user, the role, the responsible moderator, and the reason for the role removal.

For more information on setting up those logs, refer to the

permissions tutorial
log setup tutorial