Admin Alerts - CosmicCubicle/PariahBot GitHub Wiki

Admin Alerts

How PariahBot tells a server's admins about things that need attention. Each server chooses where alerts go: a channel, DMs to chosen people, or both.

This page also covers the command audit log, the bot owner's own record of every command run.

Alerts are for things that need an admin's attention, and only cover what the bot itself did or saw. For a running record of everything that happens in the server, from kicks and bans by anyone to edited messages and role changes, use the Server-Log. The two overlap on purpose for moderation: a /mod action is alerted here, and the server log names its case so the two can be matched.


What sends an alert

Feature Alert
Honeypot Someone was removed for posting in the trap, or the removal failed
Banned-Words A message was blocked: who, where, the matched word (spoilered) and which list
Temp-Voice-Channels A voice hub's channel was deleted, with Prune and Restore buttons. Sent when the bot starts
Moderation Every warning, kick, ban, temporary ban, softban, unban and timeout: who, by whom, why, for how long, and its case number. Also automatic timeouts from repeated warnings, a temporary ban ending, and a case being removed, plus any of those failing
/alerts test A test alert, to check your setup

Where alerts go

Nothing is set up until you set it up. The bot does not create a channel on its own, and in a server with no destination alerts are dropped — /alerts status says so, and the host log records each one.

Earlier versions created a PariahBot category and a #bot-alerts channel in every server, at startup and on joining. That surprised people, so it was removed. A channel an earlier version made for you is still there and still used; nothing was deleted.

Have the bot make one: /alerts restore-default takes either channel: (one that already exists) or name: (what to call a new one, with an optional category:). One of the two is required — the bot will not pick a name for you.

It is created with your server’s default permissions, so everyone may be able to see it. Restrict it in its settings, or point alerts somewhere private with /alerts channel.

Your own channel:

/alerts channel channel:#mod-log

Alerts then go here instead of the default channel. The default channel is left in place; remove it with /alerts remove-default if you don't want it.

DMs, to one or more people, as well as or instead of a channel:

/alerts add-recipient user:@You
/alerts remove-recipient user:@You

Every alert goes to the channel and to every recipient. Someone with closed DMs just misses the DM.

Removing or restoring the default channel:

Command Effect
/alerts remove-default Delete the default category and channel, and stop them being recreated
/alerts restore-default Create them again

Check and test:

/alerts status
/alerts test

status shows the channel, whether it's yours or the default, and the DM recipients. test sends one alert and reports where it arrived, and where it failed.

All /alerts commands are for staff (mods and admins).


The command audit log

Separate from alerts, and set up by the bot owner, not per server. Every command run in every server is recorded:

  • In a file: logs/commands.log on the host, always. One line per command, with the time, command, options, who ran it, where, whether it succeeded, how long it took, and any error.
  • In Discord, optionally: set in hom.env, so it covers every server the bot is in. See Configuration.
Variable Receives
LOG_CHANNEL_ID Successes and failures
LOG_CHANNEL_SUCCESS_ID Successes only. Overrides the one above for these
LOG_CHANNEL_ERROR_ID Failures only. Overrides the one above for these

Troubleshooting

What happens Fix
No alerts arrive /alerts status, then /alerts test. It says what failed
The default channel keeps coming back /alerts remove-default stops it for good
A DM recipient gets nothing Their DMs from server members are closed
Prune or Restore says you need a permission Those buttons need staff in that server: a mod role, an admin role, or Administrator. Manage Channels on its own is no longer enough

Permissions needed: Manage Channels, only to create the default channel. See Permissions.