Tutorial / Settings
Discord Logs
Post toolbox logs (bans, kicks, warnings, jails, reports and more) to a Discord channel through a webhook.
What it does
Discord Logs posts toolbox log lines to a Discord channel through a webhook. You pick which kinds of events are posted: bans, kicks, warnings, jails, player reports, other admin actions, joins and leaves, and server events.
Lines are collected and posted together every 3 seconds, in one message per batch. Each message is a code block, so names and reasons cannot ping anyone or change the formatting.
The webhook link is kept on the server and never shown again in full.
Where to find it
Q menu > KGX's Admin Toolbox > Settings > Discord Logs.
Superadmins only. Other players see the description and "Only superadmins can set this up."
The panel
| Option | What it does | Default |
|---|---|---|
| Webhook: | Shows the saved link in short form, or "not set". | - |
| Link field | Paste the webhook link here (https://discord.com/api/webhooks/...). |
Empty |
| Save the webhook link | Saves the link and turns posting on. A link that is not a Discord webhook is refused. | - |
| Remove the webhook | Asks to confirm, stops posting and forgets the link. | - |
| Posting on | Turns posting on or off without removing the link. | Off until a link is saved |
| Name shown in Discord: | The name the messages are posted under. Up to 80 characters. | KGX Admin Toolbox |
| Save the name | Saves the name. An empty name goes back to the default. | - |
| Send a test message | Posts a test message and shows the result (HTTP code) under the link. | - |
Post
| Option | What it posts | Default |
|---|---|---|
| Bans and unbans | Ban and unban actions. | On |
| Kicks | Kicks. | On |
| Warnings (and the warning ladder) | Warnings and warning ladder actions. | On |
| Jails | Jail actions. | On |
| Player reports (!report) | New player reports. | On |
| All other admin actions | Every other toolbox admin action. | Off |
| Players joining and leaving | Joins and leaves, with the leave reason. Bots are skipped. | Off |
| Server start, scheduled tasks and restarts | Server start and scheduled tasks that ran. | On |
Each checkbox is saved as soon as you tick it.
How to use it
Connect a Discord channel
- In Discord, open the channel settings > Integrations > Webhooks > New webhook > Copy webhook URL.
- In game, open Settings > Discord Logs and paste the link into the field.
- Press Save the webhook link. Webhook: now shows the short form and Posting on is ticked.
- Press Send a test message. "Test sent (HTTP ...). Check the channel." means it works.
Choose what gets posted
- Tick the kinds of events under Post.
- Tick All other admin actions only if you want every toolbox action in the channel.
- Trigger something, for example warn a bot. It shows in the channel a few seconds later.
Pause or remove it
- Untick Posting on to pause. The link stays saved.
- Press Remove the webhook and confirm to stop and forget the link.
Settings and commands
| File | What it holds |
|---|---|
garrysmod/data/kgx_admin_toolbox/discord.json |
The webhook link, name, on or off, and the categories. |
Tips and limits
- Only links on
discord.com,discordapp.com,ptb.discord.comandcanary.discord.comare accepted, starting withhttps://. - Admin actions are sorted by their text: lines with "banned" go to bans, "kicked" to kicks, "warned" or "warning" to warnings, "jail" to jails. Everything else counts as other admin actions.
- Anti-cheat strikes are admin actions, so they follow the same sorting.
- At most 200 lines wait in the queue. Lines beyond that are dropped until the queue empties.
- A Discord message holds about 1900 characters of log lines. Longer batches are split over the next posts.
- Mentions such as @everyone in names or reasons are never pinged.