# Moderation Tutorial

This guide will give you the basic information needed to moderate your Discord server with MoonlightBot. It features a list of commands and how they work, complete with their options, infractions, and log information to help you better understand how to use them.

## Command Options

These are options you may use while executing moderation commands. You can find a more in-depth guide about options in the [options page](https://moonlightbot.gitbook.io/docs/get-started/options).

![A list of example options in a mute command](https://2739437192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0Z0wam1w1IC3iv3OQ3%2Fuploads%2Fgit-blob-a5d95d08ee07118afa16651ff702bc403db7ef01%2FMuteOptions.png?alt=media)

* `user`: The user to execute the moderation action on
* `reason`: The reason for which you are taking the action, useful for record keeping. The reason shows up in infractions, logs, and notifications from the bot
* `notify`: Whether or not the bot will message the user after the command is executed, as shown below

<figure><img src="https://2739437192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0Z0wam1w1IC3iv3OQ3%2Fuploads%2Fgit-blob-0fc73c401cc0fe961c4c6862a7b44e45a163564c%2FNotifyExample.png?alt=media" alt="Notify Example"><figcaption><p>An example of a notification from the bot</p></figcaption></figure>

* `no-infraction`: Whether or not the command will count towards the user's infractions

{% hint style="info" %}
If both the `notify` and `no-infraction` options are true, the target will **not** be notified in order to prevent harassment via MoonlightBot.
{% endhint %}

* `duration`: The amount of time for which the action taken will last. For information on the format used, refer to the [options page](https://moonlightbot.gitbook.io/docs/options#Durations)
* `remove-roles`: Exclusive to the mute commands, this option will remove all of the user's roles except the muterole if true. This is to facilitate the effectiveness of the mute command

{% hint style="info" %}
You can configure MoonlightBot to ban someone if they send a message while they have the mute role by running the command `/config settings mute-evasion-ban:True`. This is a helpful backup if the mute isn't working as intended.
{% endhint %}

* `role`: The role to assign/remove in a role command

## Moderation Tools

These features help ensure a seamless moderation experience with MoonlightBot.

### User IDs

A user ID is a string of numbers that is unique to a Discord account. Unlike usernames, the user ID cannot be changed, which is useful for various purposes, such as locating a user (even if they have changed their username to avoid detection) and executing commands for a user who has left the server. A great place to use IDs is the search bar, located at the top of the page.

<figure><img src="https://2739437192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0Z0wam1w1IC3iv3OQ3%2Fuploads%2Fgit-blob-ba9e32b555bb7880843dcd056346eea4b6e2bb9c%2FSearchBar.png?alt=media" alt="Search Bar"><figcaption><p>The search bar at the top of the page</p></figcaption></figure>

To access user IDs, it is recommended that you enable [Developer Mode](https://moonlightbot.gitbook.io/docs/advanced/developer-mode), but MoonlightBot also displays user IDs next to usernames in command outputs.

### Infractions

Infractions help staff members keep track of a user's bad conduct and make informed decisions while moderating. This is a versatile tool with multiple subcommands to assist your moderation needs.

![An example of the Infractions Summary command](https://2739437192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0Z0wam1w1IC3iv3OQ3%2Fuploads%2Fgit-blob-833cea0b7c4d6a65ca5f5365e34d7dab0cc73567%2FInfractionsExample.png?alt=media)

* [**`/infractions summary`**](https://moonlightbot.gitbook.io/docs/moderation-commands/infractions#summary): This command shows the 3 most recent infractions, and the infraction count of each different infraction type. If a tempban/mute/timeout is active, the command will show that as well
* [**`/infractions detailed`**](https://moonlightbot.gitbook.io/docs/moderation-commands/infractions#detailed): This command shows the infraction type, user affected, moderator who enforced it, reason, and date created
* [**`/infractions reason`**](https://moonlightbot.gitbook.io/docs/moderation-commands/infractions#reason): This command displays the reason given to the infraction, and allows you to edit it
* [**`/infractions search`**](https://moonlightbot.gitbook.io/docs/moderation-commands/infractions#search): This command allows you to see a list of infractions within given parameters, such as the moderator who executed them
* [**`/infractions delete`**](https://moonlightbot.gitbook.io/docs/moderation-commands/infractions#delete): This command deletes a specified infraction

### Logs

When moderators execute an action such as a warn, MoonlightBot will send a message in the designated logs channel in order to keep track of moderation events. For more information on setting up logs, refer to the logs section of the [main page](https://moonlightbot.gitbook.io/docs/readme#logging).

![A log example containg a mute infraction](https://2739437192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0Z0wam1w1IC3iv3OQ3%2Fuploads%2Fgit-blob-af3192d0ee1865f5c30e0b7c44fb7f271199b2f3%2FLogExample.png?alt=media)

## Commands

All the commands listed can be found in the "Moderation Commands" and "Role Management Commands" categories.

### Ban/Kick

* [**`/kick`**](https://moonlightbot.gitbook.io/docs/moderation-commands/kick): This command removes a user from the server, but they are able to rejoin if they have an invite
* [**`/ban`**](https://moonlightbot.gitbook.io/docs/moderation-commands/ban): This command kicks a user from the server and prohibits them from rejoining
* [**`/tempban`**](https://moonlightbot.gitbook.io/docs/moderation-commands/tempban): This command temporarily bans a user for a set amount of time
* [**`/softban`**](https://moonlightbot.gitbook.io/docs/moderation-commands/softban): This command bans a user then immediately unbans them. Though similar to the kick command, this command deletes the user's messages (useful for cleaning up spam)
* [**`/unban`**](https://moonlightbot.gitbook.io/docs/moderation-commands/unban): This command unbans a user from the server, allowing them to rejoin (if they have an invite)

### Mute

{% hint style="info" %}
The mute commands requires a mute role. You can make one by using [`/create-muterole`](https://moonlightbot.gitbook.io/docs/management-commands/create-muterole); MoonlightBot will set everything up for you!
{% endhint %}

* [**`/mute`**](https://moonlightbot.gitbook.io/docs/moderation-commands/mute): This command suppresses a user from sending messages, creating threads, and adding reactions
* [**`/tempmute`**](https://moonlightbot.gitbook.io/docs/moderation-commands/tempmute): This command temporarily mutes a user for a set amount of time
* [**`/unmute`**](https://moonlightbot.gitbook.io/docs/moderation-commands/unmute): This command unmutes a user, allowing them to send messages again

### Role

* [**`/role`**](https://moonlightbot.gitbook.io/docs/role-management-commands/role): This command gives/takes a role from a user
* [**`/temprole`**](https://moonlightbot.gitbook.io/docs/role-management-commands/temprole): This command temporarily gives a role to a user for a set amount of time
* [**`/list-temproles`**](https://moonlightbot.gitbook.io/docs/role-management-commands/list-temproles): This command lists the active temproles
* [**`/pause-role`**](https://moonlightbot.gitbook.io/docs/role-management-commands/pause-role): This command takes a role from a user and gives it back after a set amount of time
