discord
Webhook posts for vote, milestone and vote party events.
discord.yml posts a message to a Discord channel through a webhook
when a vote is counted, a milestone is reached or a vote party fires.
It is a one-way push: no bot, no login, and the request runs off the
main thread.
It ships disabled. To get a webhook URL in Discord: Edit Channel, Integrations, Webhooks, New Webhook.
Quick example
enabled: true
webhook-url: "https://discord.com/api/webhooks/1234567890/abcDEF..."
username: "TDXVotePlus"
avatar-url: ""
notifications:
vote:
enabled: true
message: ":ballot_box_with_check: **%player%** just voted on **%service%** (total: %total%)"
milestone:
enabled: true
message: ":star2: **%player%** reached the **%milestone%** milestone!"
party:
enabled: true
message: ":tada: **Vote Party #%total_parties%** has triggered!"Reference
| Key | Type | Default | Notes |
|---|---|---|---|
enabled | boolean | false | Master switch. Must be true and webhook-url must be set. |
webhook-url | string | empty | The Discord webhook URL. Treat as a secret. |
username | string | TDXVotePlus | Name the post appears under. |
avatar-url | string | empty | Image URL for the avatar. Empty uses the avatar set on the webhook. |
notifications.vote.enabled | boolean | true | Post when a vote is counted. |
notifications.vote.message | string | Takes %player%, %service%, %total%, %streak%. | |
notifications.milestone.enabled | boolean | true | Post when a milestone is reached. |
notifications.milestone.message | string | Takes %player%, %milestone%, %milestone_id%, %threshold%. | |
notifications.party.enabled | boolean | true | Post when a vote party fires. |
notifications.party.message | string | Takes %total_parties%, %threshold%. |
Messages are plain Discord messages, not embeds. Discord markdown
(**bold**, :emoji:) works, MiniMessage does not. Mentions are
switched off in every post, so a player named @everyone cannot ping
your server.
Things to know
- A claimed offline vote counts as a vote, so a player returning
after a week produces seven vote posts at once. If that is too
noisy, set
notifications.vote.enabledtofalseand keep the milestone and party posts. - There is no post for the monthly payout.
- If Discord rejects a post or cannot be reached, a warning is written to console and the post is dropped. There is no retry.
- Enabling the integration with an empty
webhook-urllogs a warning and leaves it off.
Anyone with the webhook URL can post to your channel. Keep
discord.yml out of public repositories and screenshots, and
delete and recreate the webhook in Discord if it leaks.