πŸ”₯Join our Discord for support, updates, and custom commissions.
Polaroid Studio Logo
PolaroidSTUDIO
DiscordLog In

πŸ“£ Discord Webhook

Mirrors mail activity into a Discord channel, so staff can watch the post without opening a menu.

Off by default. It needs no plugin β€” just a webhook URL.

Setup

  1. In Discord: Channel settings β†’ Integrations β†’ Webhooks β†’ New Webhook, then copy its URL.
  2. In config.yml:
discord:
  enabled: true
  webhook-url: "https://discord.com/api/webhooks/..."
  flush-seconds: 5
  events:
    - SENT
    - SENT_SERVER
    - CLAIMED
    - DISMISSED
    - RETURNED
    - EXPIRED
    - ADMIN_CLAIMED
    - ADMIN_DELETED

The bot's name and avatar are fixed, and the stripe colour comes from the event. Only the URL, the window and the event list are yours to set.

  1. /mail reload.

The URL must be https://. Anything else is refused with a warning rather than sent.

Events

Every event is listed by default. Remove any you do not want to see.

EventFires when
SENTA player sent mail to another player
SENT_SERVERServer mail was queued
CLAIMEDA mail was claimed
DISMISSEDA player threw a receipt away
RETURNEDUnclaimed mail bounced back to its sender
EXPIREDUnclaimed mail was destroyed
ADMIN_CLAIMEDStaff took a copy through /mail admin
ADMIN_DELETEDStaff deleted a mail permanently

The last two are the ones worth keeping on a server with several staff members: they are the only actions that create items or destroy them irreversibly.

What a post contains

Each mail becomes one embed with everything it was carrying:

πŸ“¨ Mail sent

βœ‰οΈ A little help
Here, you'll need this more than me. Good luck out there.

πŸ“€ From             πŸ“₯ To
Anonymous (Steve)   Alex

πŸ”° Items
16Γ— Bread
1Γ— Diamond Sword

πŸͺ™ Money
250.00

πŸ”§ Staff
Notch
FieldNotes
SubjectThe heading; the letter itself is its value
FromThe sender. Server mail is marked (server)
ToThe recipient, or a count β€” see below
ItemsEvery attachment with its amount, up to twelve lines
MoneyOnly shown when there is some
StaffOnly on administrative events β€” see below

A mail with no written message reads no message under its subject.

The Staff field

It appears on SENT_SERVER, ADMIN_CLAIMED and ADMIN_DELETED, and nowhere else β€” the three events a player cannot cause on their own mailbox.

That rule is the action, not "was somebody involved". Every claim has somebody involved: the recipient. Naming them under Staff would read as a player moderating themselves.

Server mail sent from console is credited to Console; sent by an admin, to their name.

Anonymous mail is unmasked, exactly as in /mail admin: the channel shows Anonymous (Steve). Anonymity is a promise to the recipient, not to the staff channel.

Colours

The stripe is not configurable, because it carries meaning. Scanning a busy channel, the only distinction worth a colour is what the event did:

ColourMeansEvents
🟒 #87d137Finished cleanlySENT CLAIMED
🟣 #9f69ffThe server or its staff actedSENT_SERVER ADMIN_CLAIMED
🟑 #ffbc2eNothing lost, worth a lookDISMISSED RETURNED
πŸ”΄ #df3752Something was destroyedEXPIRED ADMIN_DELETED

Everything a player typed β€” subject, letter, names β€” is escaped for both JSON and Discord markdown, so a subject full of asterisks and backticks arrives as the characters somebody typed rather than as formatting.

Recipients, and why broadcasts show a number

Sent toTo field reads
One playerTheir name
server:all / server:online412 players

A broadcast is one letter delivered to many mailboxes, so listing four hundred names would bury the mail itself and tell you nothing you did not already know from the command. The count is the useful part.

Why posts are grouped

flush-seconds is not a delay for its own sake. Everything inside a window becomes one message, grouped by the mail rather than by the event β€” which is exactly what makes the detail above affordable.

A server:all broadcast records one event per recipient. On a server with a thousand known players, one command is a thousand events, against a webhook Discord limits to roughly thirty requests a minute. Sent individually they would be rate-limited within seconds, and most of what you wanted to see would be the part that got dropped.

Because the grouping is on content, that whole broadcast collapses into a single embed carrying the full letter, with the audience as a count. Names are only looked up where one will actually be printed, so a thousand-player broadcast costs no name lookups at all.

Raise flush-seconds if Discord ever rate-limits you; the plugin says so in console when it does.

What it will not do

  • It never blocks the server. Posting is asynchronous, and a queue that fills up drops events with a console warning rather than growing without limit. An unreachable Discord must never become a laggy Minecraft server.
  • It is independent of the transfer log. log.enabled: false silences the database log and leaves the webhook running, and the reverse works too. They answer different questions.
  • Player text cannot restyle the post. Subjects are escaped for both JSON and Discord markdown, so a subject full of backticks and asterisks arrives as the characters somebody typed.