Skip to content

Webhook


Discord Webhook Integration

Cobblemon BattleHUB can push tournament events straight to a Discord channel through a webhook: when a tournament starts, when a match is called, when a match ends, and when a champion is crowned. The current bracket is rendered to an image and attached automatically to the start / update / match-end messages.

Tournaments only

This webhook covers the tournament system. Ranked / casual match results and season rollovers are not sent here.


File Path

config/cobblemon_battlehub/webhook.json


Default Configuration Template

Generated by WebhookConfig.java on first startup:

{
  "enabled": false,
  "webhookUrl": "WEBHOOK_URL",
  "msgTournamentStart": {
    "content": "@everyone",
    "title": "🏆 Tournament {name} has Started!",
    "description": "The bracket has been drawn for the **{participants}** participants.\n\n**INITIAL BRACKET:**\n{bracket}\n\n*Good luck to all trainers!*",
    "colorHex": "#8A2BE2",
    "thumbnailUrl": "",
    "imageUrl": ""
  },
  "msgMatchCalled": {
    "content": "",
    "title": "⚔️ New Match Called!",
    "description": "**{phase}** is about to begin!\n\n🔸 **{p1}** vs **{p2}**\n\nOpen your menus and prepare your teams!",
    "colorHex": "#8A2BE2",
    "thumbnailUrl": "",
    "imageUrl": ""
  },
  "msgMatchWinner": {
    "content": "",
    "title": "🔥 Battle Ended!",
    "description": "**{winner}** defeated **{loser}** in **{phase}** and advances in the tournament bracket!",
    "colorHex": "#8A2BE2",
    "thumbnailUrl": "",
    "imageUrl": ""
  },
  "msgTournamentWinner": {
    "content": "@everyone",
    "title": "👑 WE HAVE A CHAMPION!",
    "description": "The grand winner of the **{name}** tournament is **{winner}**!\n\nCongratulations on the victory and thanks to everyone who participated!",
    "colorHex": "#8A2BE2",
    "thumbnailUrl": "",
    "imageUrl": ""
  }
}

Turning it on

  1. In Discord: Channel settings → Integrations → Webhooks → New Webhook, then Copy Webhook URL.
  2. Paste that URL into webhookUrl.
  3. Set "enabled": true.
  4. Run /bh reload (or restart the server).

Set a real URL

Leaving webhookUrl at the placeholder WEBHOOK_URL while enabled is true will produce failed send attempts in the log. Either paste a valid webhook URL or keep enabled: false.


The four message events

Key Fires when Auto-attaches bracket image
msgTournamentStart The bracket is drawn and the tournament begins (also re-sent when the bracket advances a round). Yes
msgMatchCalled A specific match is called and both players enter the 3-minute prep window. No
msgMatchWinner A tournament match ends. Yes
msgTournamentWinner The final match ends and a champion is decided. No

Fields inside each message

Field Purpose
content Plain text outside the embed. This is where a real @everyone / <@&roleId> ping has to go — pings inside title/description don't notify. Leave "" for no ping.
title Embed title (bold heading line).
description Embed body. Discord markdown works: **bold**, *italic*, and \n for line breaks.
colorHex The embed's left border color, as a hex string (#8A2BE2). Invalid values are ignored.
thumbnailUrl Small image in the embed's top-right corner. Must be a public URL.
imageUrl Large image at the bottom of the embed. Ignored on messages that auto-attach the bracket image (msgTournamentStart, msgMatchWinner) — the generated bracket.png takes that slot.

Dynamic Variables and Placeholders

Terms in curly braces are replaced before the payload is sent. Any placeholder that has no value for a given event is replaced with an empty string. Usable in content, title, and description:

Placeholder What it replaces
{name} Tournament display name from its profile.
{participants} Number of registered players (start message only).
{phase} The match block identifier (e.g. Round 1 - Match 3).
{p1} First player in the called match.
{p2} Second player in the called match.
{winner} Player who won the match, or the tournament champion.
{loser} Player who lost the match.
{bracket} A short text/link to the bracket (the actual bracket picture is attached separately as an image).

Reload

After editing webhook.json:

/bh reload