Moderation - CosmicCubicle/PariahBot GitHub Wiki

Moderation

Warn, kick, ban and time out members with /mod, or by right-clicking them. Every action:

  • DMs the member
  • is recorded in the server's audit log, with the reason and the moderator's name
  • is kept in the member's history (/mod history)
  • is reported through the Admin-Alerts

Repeated warnings can time someone out automatically.

Moderation is for mods (a mod role) and admins. Only admins can change the moderation settings (/mod config) or remove a case. See Server-Roles.


Commands

Command What it does
/mod warn member reason Record a warning and DM it to them. Counts towards an automatic timeout, if that's on
/mod kick member [reason] DM the member, then kick them. They can rejoin with an invite
/mod ban user [reason] [delete_messages] [duration] DM, then ban. Add duration for a temporary ban
/mod softban user [reason] [delete_messages] Ban, then unban straight away. Their messages are deleted, but they're not kept out
/mod unban user [reason] Lift a ban. Suggestions come from this server's ban list
/mod timeout member duration [reason] Stop them sending messages, reacting or joining voice, for up to 28 days
/mod untimeout member [reason] End a timeout early
/mod history user Everything recorded against someone. See below
/mod remove-case case Delete one record from history, e.g. a mistaken warning
/mod config … Automatic timeouts and the ban appeal note. See below

Options:

  • reason (up to 400 characters): included in their DM, the audit log and the alert. Optional, but worth giving.
  • delete_messages: how far back to delete their messages.
    • Choices: none, last hour, last 24 hours or last 7 days.
    • Defaults to none for a ban and last 24 hours for a softban.
  • duration: 10m, 2h, 1d, 7d, 1d12h… Units are d, h, m and s.
    • Timeouts are capped at 28 days, Discord's limit.
    • Temporary bans are capped at 365 days.
  • user on ban and softban can be someone who isn't in the server. Paste their user ID to ban a known spammer before they join.

Right-click actions

Right-click a member (in the member list, or on their name in chat) → Apps:

  • Kick member
  • Ban member: leave the duration empty for a permanent ban, or enter one like 7d
  • Timeout member: the duration is required

A short form asks for the reason, and the duration where it applies. They do exactly the same as /mod, with the same checks. A right-click ban doesn't delete messages; use /mod ban for that.

Everyone sees these in the Apps menu, but only admins can use them.


Safety checks

Every action is refused, with the reason, if:

Check Why
The target is staff: Administrator, an admin role or a mod role The bot never acts against its own staff. Remove their role first if you really mean it
The target's highest role is not below yours The same rule as Discord's own kick and ban. The server owner can act on anyone
The target's highest role is not below the bot's Discord won't let the bot act on them. Move the PariahBot role up in Server Settings → Roles
The target is you, the bot, or the server owner —
The bot is missing the permission (Kick Members, Ban Members or Timeout Members) It says which one to add
The target is already banned (ban, softban) or not timed out (untimeout) —

Nothing is sent or changed until every check passes.

DMs:

  • Kicks, bans and softbans: the DM goes out before the action, because the bot can't message someone after they've left the server. It says what happened and why. A temporary ban DM also says when it ends.
  • Closed DMs: the action goes ahead anyway, and the reply says the DM couldn't be delivered.

Temporary bans

/mod ban user:@Someone duration:7d reason:Cool off
  • When it ends, the bot unbans them and sends an alert.
  • Restarts are fine. Temporary bans are saved, and one that ended while the bot was offline is lifted as soon as it starts.
  • /mod unban ends it early. Banning them again replaces it: with a duration it gets the new end time, and without one it becomes permanent.
  • Unbanned by hand? If someone was unbanned in Server Settings → Bans, the bot just forgets the temporary ban.
  • If an unban fails, for example because Ban Members was removed, the bot alerts you and tries again at its next restart.

History

/mod history user:@Someone

Shows everything recorded against them in this server, newest first:

  • What's recorded: warnings, timeouts (manual and automatic), timeouts removed, kicks, softbans, bans, temporary bans, and unbans (by a moderator, or a temporary ban ending).
  • Honeypot removals are recorded too.
  • The top line has the total of each type. Below it are the latest 15, each with:
    • its case number
    • the date
    • who did it (PariahBot when the bot acted on its own)
    • the length, where there is one
    • the reason
  • If automatic timeouts are on, the footer says how close they are to the limit.

It works for someone who has left or been banned: paste their user ID.

Every action's reply and alert shows its case number. To delete one record, for example a warning given by mistake:

/mod remove-case case:12

That only removes the record. A ban or kick it describes still stands, but a removed warning no longer counts towards an automatic timeout. The removal is itself reported through the alerts.


Warnings and automatic timeouts

/mod warn member:@Someone reason:Keep it civil
  • The member is DMed with the reason, and the warning is added to their history.
  • No bot permission is needed, since nothing changes in Discord. Staff (admins and mods) still can't be warned.

To time members out automatically after repeated warnings:

/mod config escalation warnings:3 within:7d timeout:1h
  • When it fires: the member's 3rd warning within 7 days times them out for an hour, and so does each further warning in that window.
  • Who acts: the bot does, with its own reason (Automatic: 3 warnings within 7 days). The timeout is DMed, recorded and reported like any other.
  • If the bot can't time them out (missing Timeout Members, or its role is too low), the warning still counts, and an alert says why.
  • Limits:
    • warnings is 2 to 20
    • within is up to 365 days
    • timeout is up to 28 days
  • Turning it off: /mod config escalation-off. Warnings are still recorded.

Appeal note

/mod config appeal-note text:Appeal at https://example.com/appeal

Adds that line to the end of every ban DM, temporary or permanent. Up to 300 characters. /mod config appeal-note-clear removes it, and /mod config show shows both settings.


What gets reported

Every action sends an Admin-Alerts message with:

  • the member, the moderator and the reason
  • the length, for bans and timeouts
  • its case number

So do a temporary ban ending (or failing to end), an automatic timeout (or a failed one), and a case being removed. The server's own audit log also shows each action, with the reason followed by — by <moderator>.

If the Server-Log's Kicks and bans section is on, kicks, bans and unbans also appear there, whoever made them. The ones made through the bot name their case, e.g. #12, through the bot by @Moderator.


Troubleshooting

What happens Fix
"…is staff" Expected: the bot never acts on its own admins or mods. Take their role away first
"Your highest role isn't above…" Ask someone higher up, or the server owner
"My highest role isn't above…" Move PariahBot above their highest role in Server Settings → Roles
"I need the … permission" Add it to the PariahBot role. Bots invited before /mod existed may lack Kick Members and Timeout Members
The right-click actions don't appear Refresh Discord with Ctrl+R. New commands can take a while to show
"That user isn't banned here" Pick from the /mod unban suggestions, or check the ID

Permissions needed: Kick Members, Ban Members and Timeout Members. See Permissions.

⚠️ **GitHub.com Fallback** ⚠️