Discord
Mirror audit events and new listings to a Discord channel through an incoming webhook, with per-event toggles and colour-coded embeds.
AT-ShoppingMall can post plugin events to a Discord channel through an incoming webhook. Every audit entry and every new plot listing can show up in your staff channel, as either a tidy plain message or a colour-coded embed. It is off by default and posts nothing until you add a webhook URL.
All Discord posting runs on a background thread, so a slow or unreachable webhook never lags the server. Failures are logged as a warning and otherwise ignored.
Setup
Create a webhook in Discord
In your channel: Channel Settings → Integrations → Webhooks → New Webhook, then Copy Webhook URL.
Paste it into the config
Open config.yml, set enabled: true, and paste the URL:
discord:
enabled: true
webhook-url: "https://discord.com/api/webhooks/..."
username: "ShoppingMall"
avatar-url: "" # optional direct image URLReload
Run /sm reload. Posting starts immediately. If enabled is false or the URL is
blank, nothing is sent.
Choosing what gets posted
Each event type has its own on/off switch under discord.events. All default to true,
so once enabled you get everything. Flip any to false to silence it.
discord:
events:
new-listing: true # a plot becomes available for rent/purchase
plot-create: true
plot-delete: true
evict: true
eviction-request: true
reset: true
delist: true
price-change: true
redefine: true
toggle-pvp: true
save-preset: true
availability: true
rent: true
other: trueThese line up one-to-one with the audit log types.
The one exception is new-listing, which fires from the listing alert system rather than
the audit log.
Embeds vs plain text
use-embeds picks the look:
use-embeds: true posts a coloured card with a title, a short description, and optional
fields (actor, plot, owner, tenant). Colours are per-event, set as hex codes without
the leading #.
discord:
use-embeds: true
format:
audit-title: "Shopping Mall » {type}" # {type} = friendly event name
new-listing-title: "New Listing"
footer: "AT-ShoppingMall" # blank to hide
show-timestamp: true
show-fields: true # actor / plot / owner / tenant
color-default: "5865F2"
color-create: "57F287"
color-delete: "ED4245"
color-evict: "ED4245"
# ... one color- key per event typeuse-embeds: false posts a single line of text instead, for example
PlayerName evicted tenant from plot shop-12. The format block is ignored in this
mode.
Posts can never ping your members. @everyone, @here, and user mentions in plot or
player names are defused automatically before sending.
Appearance options
| Key | Default | What it controls |
|---|---|---|
username | ShoppingMall | The name posts appear under. |
avatar-url | (blank) | Avatar image. Blank uses the webhook's own avatar. Must be a direct image URL. |
format.audit-title | Shopping Mall » {type} | Title line on audit embeds. {type} is the friendly event name. |
format.new-listing-title | New Listing | Title on new-listing embeds. |
format.footer | AT-ShoppingMall | Small footer text. Blank hides it. |
format.show-timestamp | true | Show the event time on the embed. |
format.show-fields | true | Show actor / plot / owner / tenant as fields. |
format.color-* | various | Per-event embed colours (hex, no #). |