Skip to content

Configuration

DynaDev edited this page Aug 12, 2026 · 1 revision

Configuration

The main configuration file is:

plugins/TownyAlerts/config.yml

The exact comments in the distributed file should be treated as the primary reference for the installed version.

A representative 1.0.0-beta.3 configuration looks like this:

# Language used by TownyAlerts.
# Examples: en, en-us, es, es-cl, es-mx, fr, fr-ca, en-uk.
# Language names are case-insensitive.
# Invalid or unavailable languages fall back to English.
language: "en"

console:
  startup-banner: true

discord:
  channel-id: "PUT_CHANNEL_ID_HERE"

  channels:
    new-day: ""
    bankruptcy: ""
    ruin: ""

alerts:
  new-day-summary: true
  town-bankruptcy: true
  town-ruined: true
  fallen-towns: true
  fallen-nations: true
  pre-new-day: false

missed-new-day:
  enabled: true
  lookback-hours: 12
  allow-log-fallback: true

format:
  server-name: "My Towny Server"
  timestamp: true
  footer: "TownyAlerts • DynaDev"

mentions:
  enabled: false

retry:
  enabled: true
  max-attempts: 3
  delay-seconds: 5

storage:
  type: memory
  server-id: "default"

  sqlite:
    file: "townyalerts.db"

  remote:
    host: "127.0.0.1"
    port: 3306
    database: "townyalerts"
    username: ""
    password: ""
    password-env: ""
    ssl: false
    connection-timeout-ms: 5000

  schema:
    auto-create-tables: true

  history:
    enabled: true
    retention-days: 0

debug: false

Language

language: "en"

The value is case-insensitive.

Examples:

en
EN
en-us
EN-US
es
ES
es-cl
ES-CL
fr-ca

_ is also normalized to -, so es_CL is treated like es-cl.

Invalid or unavailable languages fall back to en-us.

Startup banner

console:
  startup-banner: true

Set this to false to disable the ASCII startup logo.

Essential startup logs are still printed.

Discord channel

discord:
  channel-id: "YOUR_CHANNEL_ID"

This is the default destination for all alerts.

Optional event-specific channels can override it:

discord:
  channels:
    new-day: ""
    bankruptcy: ""
    ruin: ""

An empty event-specific channel inherits the default channel-id.

Alerts

Each main alert category can be enabled or disabled independently:

alerts:
  new-day-summary: true
  town-bankruptcy: true
  town-ruined: true
  fallen-towns: true
  fallen-nations: true
  pre-new-day: false

pre-new-day must not be interpreted as confirmation that taxes were successfully collected. It only represents a pre-processing stage when enabled.

Missed New Day

missed-new-day:
  enabled: true
  lookback-hours: 12
  allow-log-fallback: true

See Missed New Day for the exact behavior and limitations.

Mentions

mentions:
  enabled: false

TownyAlerts protects Discord messages against accidental mentions such as @everyone or @here.

Retry

retry:
  enabled: true
  max-attempts: 3
  delay-seconds: 5

Retry is bounded and is intended for cases where DiscordSRV/JDA is still initializing.

TownyAlerts does not create infinite retry loops.

Debug mode

debug: false

Enable debug logging only when diagnosing an integration problem.

Clone this wiki locally