Skip to content

Configuration

ProTerUga edited this page Jul 21, 2026 · 13 revisions

Configuration

The config.yml file is auto-generated upon first start.

# ──────────────────────────────────────────────────────────────────────────────
# DonationAlertsAPI Plugin Configuration
# ──────────────────────────────────────────────────────────────────────────────
# You can find full documentation here:
# https://github.com/ProTerUga/DonationAlertsAPI/wiki/Configuration
#
# Your DonationAlerts OAuth2 access token.
# Obtain it via the authorization code flow:
# https://www.donationalerts.com/apidoc#authorization__authorization_code
#
# REQUIRED. The plugin won't work without it.
# Step-by-step guide you can find here:
# https://github.com/ProTerUga/DonationAlertsAPI/wiki/Obtaining-access%E2%80%90token
access-token: ""


# These parameters are needed to easily obtain an access token.
# If you already have one and/or you know what to do,
# you don't have to fill in these fields.

# Your OAuth2 application's App ID.
client-id: ""
# Your OAuth2 application's API Key (Client Secret). Keep this private!
client-secret: ""
# The redirect URL configured in your DonationAlerts application.
redirect-uri: http://localhost:8080/callback

# Delay (in seconds) before attempting to reconnect to the Centrifugo WebSocket
# after a disconnection or failure. The plugin will retry indefinitely.
reconnect-delay: 10

# Logging options – control what gets printed to the server console.
log-donations: true          # Log each donation received
log-info: true               # Log connection status, authentication, subscription events
log-web-socket: false        # Log raw WebSocket messages (incoming/outgoing)


# ──────────────────────────────────────────────────────────────────────────────
# Built-in Commands
# ──────────────────────────────────────────────────────────────────────────────
# If you don't want to handle donations via your own code, enable these commands.
# They will run automatically whenever a donation arrives, using the placeholders
# described below. Commands are executed by the console (with full permissions).

enable-builtin-commands: true

# List of commands to execute when a donation is received.
# Available placeholders (case‑sensitive):
#   $sender$ - donor's display name
#   $amount$ - donation amount (numeric)
#   $currency$ - currency code (USD, EUR, RUB, etc.)
#   $message$ - donation message (can be empty)
#   $recipient_amount$ - actual amount that the recipient received. (numeric)
#
# Each command is a string exactly as you would type it in the console.
# For Minecraft chat/actionbar/title commands, use the appropriate syntax.
#
# In addition, the plugin has several built-in functions
# that will allow you to get more opportunities.
# Usage syntax: "[command_name] params..."
#
# List of built-in functions:
# [sound] - play sound to player(s)
# [message] - send message to player(s)
# [times] - set timings for title & subtitle to player(s)
# [title] - send title message to player(s)
# [subtitle] - send subtitle message to player(s)
# [actionbar] - send actionbar message to player(s)
# [effect] - apply potion effect to player(s)
#
# See more information here:
# https://github.com/ProTerUga/DonationAlertsAPI/wiki/Configuration
commands:
  - "[sound] minecraft:entity.player.levelup music 1.0 0.5 $sender$"
  - "[message] @a Test <gradient:#ffff00:#ff00ff>DONATION</gradient>!!! <#ff5555>Test \"red\" <reset>and <yellow><bold><italic>YeLlOw<reset><br>$message$"
  - "[times] @a 10 100 10"
  - "[title] @a <gradient:#fce362:#d14364>>> Donation! <<</gradient>"
  - "[subtitle] @a <bold>$sender$<reset> <gray>- <aqua>$amount$ $currency$"
  - "[actionbar] @a <green><underlined>+$amount$⛀"
  - "[effect] @a minecraft:levitation 100 0"
  - give @a minecraft:diamond 4
  - tellraw $sender$ {"text":"❀ Thanks for donation!","color":"green"}


# ──────────────────────────────────────────────────────────────────────────────
# Messages
# ──────────────────────────────────────────────────────────────────────────────
# All messages sent to players and the console are defined here.
# The plugin uses MiniMessage (Adventure) natively – no legacy color codes (&) are supported.
# You can use any MiniMessage tag: <color>, <gradient>, <bold>, <click>, <hover>, etc.

messages:
  prefix: "<dark_gray>[<gradient:#F2A544:#FFDC80>DonationAlertsAPI</gradient>]</dark_gray> "
  command:
    usage: "Use /donationalertsapi <...>"
    unknown: "<red>Unknown command."
    dont-have-permission: "<red>You don't have permission to do it."
  reload:
    successfully-reloaded: "<green>Configuration reloaded!"
    successfully-connected: "<green>Successfully connected to DonationAlerts!"
    reconnect-trying: "<yellow>Reconnecting... Check result in a few seconds."
    missing-token: "<red>Cannot connect: access-token is missing."
    connection-failed: "<red>Connection failed. Check console for errors."
    error: "<red>Failed to reload configuration. Check the console for errors."
  status:
    connected: "<gray>Connection status: <green>Connected"
    not-connected: "<gray>Connection status: <red>Not connected"
  test:
    usage: "Use /donationalertsapi test <SenderName> <Amount> <Currency> \"<Message>\""
    number-format-error: "<red>Invalid format of float number"
    connection-warning: "<yellow>Warning! DonationAlerts is NOT connected!"
    donation: "<green>The donation was successfully triggered."
  auth:
    missing-client-id: "<red> Client ID is not set in config.yml. Please set it and reload."
    url-message: '<aqua>Open this URL in your browser and copy an authorization code
          from the search bar (...?code=<code>): <underlined><white><click:open_url:''$url$''><hover:show_text:''Click''>$url$<reset><br>
          <aqua>After that, run at console /daapi token <code>'
  token:
    usage: "Use /donationalertsapi token <YourClientCode>"
    successfully-obtained: "<green>Access token successfully obtained and saved! The plugin will reconnect."
    failed: "<red>Failed to exchange code. Check console for details."


# ──────────────────────────────────────────────────────────────────────────────
# MiniMessage Quick Reference
# ──────────────────────────────────────────────────────────────────────────────
#   <color>                          e.g., <red>, <blue>, <#FF00FF>
#   <gradient>                       e.g., <gradient:#FFCF75:#F07832>text</gradient>
#   <bold>, <italic>                 text decorations
#   <click:run_command:/command>     clickable text
#   <hover:show_text:"hover text">   hover tooltips
#   <reset>                          resets all styling
#
# Full documentation: https://docs.papermc.io/adventure/minimessage/format/
# ──────────────────────────────────────────────────────────────────────────────

debug: false

Sections

access-token

Default: access-token: ""

Required. Your OAuth2 token from DonationAlerts. REQUIRED. The plugin won't work without it. Step-by-step guide you can find here: Obtaining access-token Guide

client-id

Default: client-id: ""

Your OAuth2 application's App ID.

client-secret

Default: client-secret: ""

Your OAuth2 application's API Key (Client Secret). Keep this private!

redirect-uri

Default: redirect-uri: http://localhost:8080/callback

The redirect URL configured in your DonationAlerts application.

reconnect-delay

Default: reconnect-delay: 10

Delay in seconds before reconnecting after a disconnection.

log-donations

Default: log-donations: true

Log each donation to console.

log-info

Default: log-info: true

Log connection status, authentication, subscription events to console.

log-web-socket

Default: log-web-socket: false

Log raw WebSocket messages (incoming/outgoing) to console.

enable-builtin-commands

Default: enable-builtin-commands: true

If you don't want to handle donations via your own code, enable this option. When a donation arrives, the plugin will automatically execute a list of commands as the console.

commands

This is a large section, which is why it was moved to another Wiki page.

messages

This section is responsible for the localization of the plugin's messages. You can change them as desired.

  • The messages.auth.url-message section has a $url$ placeholder, which will be replaced with the corresponding url.
  • All messages sent to players and the console are defined here. The plugin uses MiniMessage (Adventure) natively β€” legacy color codes (&) are not supported. For complete MiniMessage documentation, visit https://docs.papermc.io/adventure/minimessage/format/

debug

Default: debug: false

The debug section determines whether additional debug messages will be logged to the console.

Clone this wiki locally