TDXDevelopment
TDX VotePlusConfiguration

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

plugins/TDXVotePlus/discord.yml
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

KeyTypeDefaultNotes
enabledbooleanfalseMaster switch. Must be true and webhook-url must be set.
webhook-urlstringemptyThe Discord webhook URL. Treat as a secret.
usernamestringTDXVotePlusName the post appears under.
avatar-urlstringemptyImage URL for the avatar. Empty uses the avatar set on the webhook.
notifications.vote.enabledbooleantruePost when a vote is counted.
notifications.vote.messagestringTakes %player%, %service%, %total%, %streak%.
notifications.milestone.enabledbooleantruePost when a milestone is reached.
notifications.milestone.messagestringTakes %player%, %milestone%, %milestone_id%, %threshold%.
notifications.party.enabledbooleantruePost when a vote party fires.
notifications.party.messagestringTakes %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.enabled to false and 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-url logs 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.