Skip to main content

Audit Notifications

Post a plain-text notice to a moderator channel when members join, leave, or change names or roles, and when messages are deleted, edited, or contain links or files.

Why Use This Feature?

  1. Sends each type of event to its own channel, so moderators can follow joins separately from message edits.
  2. Leaves message text out of every notice, so the audit channel doesn't keep a copy of deleted or edited messages.
  3. Lists only the websites a link points to, so tracking tokens and private paths in URLs aren't repeated.
  4. Requests each intent only for the routes you configure, so the bot reads no more than those routes need.

How It Works

Each audit route you configure sends its notices to its own channel.

Section (setting)Sent whenThe notice includes
Members joining (guild-join)A member joinsThe member, their ID, and when the account was created
Members leaving (guild-leave)A member leavesThe member and their ID
Nickname changes (change-nickname)A member's nickname changesThe previous and current nickname
Username changes (change-username)A member's username changesThe previous and current username
Role changes (role-change)A member's roles changeThe roles added and removed
Deleted messages (delete-message)A message is deletedThe message ID, the author ID, and the channel, without the text
Edited messages (update-message)A member edits a message's textThe member, the channel, and a link, without the text
Messages with links (includes-link)A new message contains a linkThe member, the channel, up to 10 website hosts, and a link
Attachments (upload-attachment)A new message has filesThe member, the channel, up to 10 file names, and a link
  • Seen since the last reconnect — The bot reports deletes and edits only for messages it saw after its last reconnect, up to 200 per channel, and leaves, nickname changes, username changes, and role changes only for members it saw after its last reconnect.
  • Bulk deletes — Messages removed together in a bulk delete aren't reported.
  • Bot messages — Deletes include messages from bots, while edits, links, and files skip them.
  • Excluded links — Links that match an excluded link are dropped from the link notice, and a message whose links are all excluded posts no notice.

tip

Audit notifications post in your Discord channels. Alerts about the bot itself, such as a failed sign-in or a job that gave up, come from Notifications instead.

Requirements

RoutesGateway intent
guild-join, guild-leave, change-nickname, change-username, role-changeServer Members, a privileged intent
delete-message, update-message, includes-link, upload-attachmentGuild Messages
includes-link, update-messageMessage Content, a privileged intent

The bot also needs View Channel and Send Messages in each route's channel.

warning

The upload-attachment route doesn't request the Message Content intent. Discord leaves file details out of messages for bots without that intent, so this route may stay silent unless another enabled feature requests it.

Settings

Each route appears as its own section, and at least one route is required.

FieldDescription
Channel (<route>.channel)The channel that receives this route's notices.
Links to ignore (includes-link.excluded-links)Optional list of up to 100 links to ignore, each with a Name and a Regular expression.

Example

Audit notifications settings
json
{
  "guild-join": { "channel": { "channel-id": "123456789012345678" } },
  "role-change": { "channel": { "channel-id": "123456789012345678" } },
  "includes-link": {
    "channel": { "channel-id": "123456789012345679" },
    "excluded-links": [
      { "name": "Discord", "regex": { "pattern": "^https://(www\\.)?discord\\.com/", "flags": "i" } }
    ]
  }
}

Limits

  • Links — The bot reads the first 25 URLs in a message and lists up to 10 hosts.
  • Files — Up to 10 file names, each cut to 100 characters.
  • Notice length — Each notice is cut at 2,000 characters.

Troubleshooting

  • A deleted message wasn't reported — The message arrived before the bot's last reconnect, fell outside the 200 most recent messages in its channel, or went in a bulk delete.
  • The file route stays silent — Turn on a feature that requests the Message Content intent, as described in the warning above.
  • "Configured audit channel is unavailable." — This log entry means a route's channel is a category, forum, or other channel that can't hold messages. A deleted channel logs "Unknown Channel" instead.

Changes from the legacy bot

The legacy bot sent embeds that copied message text, re-uploaded attachments, and reported bulk deletes one message at a time. The rewrite sends plain text without message content, lists hosts instead of full URLs and file names instead of files, and doesn't report bulk deletes.