Discord logging bot for a full audit log
Joins, leaves, deleted and edited messages, bans, role and nickname changes and voice activity, posted to a channel you choose.
who took the diamonds from the shared chest
- Plan
- Free, always on
- Setup
- A token, then /setlog
- Privileged intents
- Server Members, Message Content
- Events
- Nine kinds, each on or off
What the logging bot does
Deleted and edited messages
A deleted message is logged with its text and its channel. An edit shows what it said before and after, with a link to it.
Joins, leaves and bans
Who joined and how old their account is, who left and which roles they had, bans and unbans.
Roles and nicknames
Roles given and taken in one entry, and the old and new nickname side by side.
Voice, if you want it
Joining, leaving and moving between voice channels. It starts off because it is noisy; /logtoggle turns it on.
Set it up
- 1
Create the bot
At discord.com/developers, New Application, then Bot and Reset Token. Copy the token.
- 2
Turn on the intents
Under Bot, Privileged Gateway Intents: Server Members for joins and leaves, Message Content for what deleted and edited messages said.
- 3
Invite it
With the
botandapplications.commandsscopes, and access to the channels you want logged. - 4
Deploy it
Press Deploy free, pick the Logging Bot template and paste the token.
- 5
Point it at a channel
Run
/setlog #server-log./logtoggleturns a kind of event on or off and/logstatusshows what is on.
Commands
- /setlog #channel
- Where the log goes.
- /logtoggle event enabled
- Turns one kind of event on or off.
- /logstatus
- The log channel and which events are on.
The nine kinds: member joins, member leaves, deleted messages, edited messages, bans, unbans, role changes, nickname changes and voice. All start on except voice.
Environment variables
They live in the table on the bot's page in the panel, values masked once saved. The template's form asks for the ones it needs when you deploy.
| Variable | Needed | What it is |
|---|---|---|
| DISCORD_TOKEN | Required | Your bot token. |
| LOG_CHANNEL_ID | Optional | The log channel, if you would rather not use /setlog. |
Which plan it needs
The free plan runs it, always on. In a large, busy server it remembers more messages to log their edits and deletions, and Starter's 1 GB gives it room.
Free
Recommended$0
No card
- 256 MB and a quarter of a CPU, always on
- No card: one free bot or app per person
- No renewals. Only a bot with no network traffic for 7 days is stopped
Starter
$2/mo
or $20 a year
- 1 GB of memory and a full vCPU
- Never stopped for being quiet
- You pick the region it runs in
Running more than one? Standard carries two bots or apps for $3 a month and Pro four for $6, on one bill with your game servers. Every plan
Frequently asked questions
Why does a deleted message show no author or text?
Discord tells a bot only that a message went, not what it said. The bot fills that in from the messages it saw arrive, so a message sent before it last started is logged by channel alone.
Which events can I turn off?
All nine: member joins, member leaves, deleted messages, edited messages, bans, unbans, role changes, nickname changes and voice. Voice starts off and the rest start on.
Who can see the log?
Whoever can see the channel you pick. Make it a private channel for your staff: deleted messages are in there word for word.
Is the logging bot free?
Yes. It runs on the free plan, always on, with no card. One bot or app is free per person; a second one needs a paid plan, from $2 a month for one or $3 for two.
More ready-made bots
Bringing your own code instead? How a bot deploys from GitHub
Keep a log of your server
Your first bot is free, with no card. It logs in within a minute.