Skip to main content

Discord Webhooks

CocoKOTH can send KOTH events to Discord using webhooks.

Configuration

Add webhook configuration to any KOTH file:

plugins/CocoKoth/koths/example.yml
webhook:
url: "https://discord.com/api/webhooks/YOUR_WEBHOOK_URL"

start:
enabled: true
content: "Get ready!"
color: "#FF0000"
title:
text: "%displayName% - STARTED"
fields:
1:
inline: true
name: "Time"
value: "%timeLeft_formatted%"

stop:
enabled: true
color: "#CC0000"
title:
text: "%displayName% - STOPPED"
fields:
1:
inline: true
name: "Time"
value: "%timeTaken_formatted%"

capture-start:
enabled: true
color: "#AAFFAA"
title:
text: "%displayName% - CAPTURE STARTED"
fields:
1:
inline: true
name: "Capturer"
value: "%capturer%"
2:
inline: true
name: "Time"
value: "%timeLeft_formatted%"

capture-end:
enabled: true
color: "#FFAAAA"
title:
text: "%displayName% - CAPTURE STOPPED"
fields:
1:
inline: true
name: "Capturer"
value: "%capturer%"
2:
inline: true
name: "Time"
value: "%timeLeft_formatted%"

captured:
enabled: true
content: ":tada:"
color: "#00FF00"
title:
text: "%displayName% - CAPTURED"
fields:
1:
inline: true
name: "Capturer"
value: "%capturer%"
2:
inline: true
name: "Time"
value: "%timeTaken_formatted%"

Available Events

EventDescription
startKOTH event started
stopKOTH event stopped
capture-startPlayer started capturing
capture-endPlayer stopped capturing
capturedKOTH was captured

Placeholders

PlaceholderDescription
%displayName%KOTH display name
%capturer%Current capturer name
%timeLeft_formatted%Time remaining formatted
%timeTaken_formatted%Time taken formatted
%starter%Player who started the KOTH

Setup Guide

  1. Go to your Discord server settings
  2. Navigate to IntegrationsWebhooks
  3. Click New Webhook
  4. Copy the webhook URL
  5. Paste the URL in your KOTH configuration
  6. Enable the events you want to send
  7. Reload the plugin: /koth reload

Embed Customization

Each webhook event supports:

  • content: Plain text message above the embed
  • color: Hex color for the embed sidebar
  • title.text: Embed title
  • fields: Multiple inline or block fields with name and value