
TownyAlerts 是由 DynaDev 开发的一款轻量级社区插件,它监听官方 Towny 事件并通过 DiscordSRV 将管理警报直接发送到 Discord。
它不会修改 Towny、税收、维护费、城镇、国家或玩家余额。TownyAlerts 仅作为观察者和通知层运行。
功能特性
- 每日 Towny 新日总结
- 城镇破产警报
- 城镇废墟警报
- 城镇与国家消亡通知
- 服务器/插件宕机后检测未执行的新日
- 通过现有的 DiscordSRV 机器人发送 Discord 消息
- 每种事件类型对应独立的 Discord 频道
- 动态语言系统
- 内置语言:
en-us — 美式英语
es-cl — 拉美西班牙语
- 支持自定义社区语言文件
- 可选存储后端:
- 持久化事件去重
- 无遥测数据收集
- 无更新检查器
- 无需 Discord Webhook 或额外的机器人令牌
工作原理
TownyAlerts 监听 Towny 的官方 Bukkit 事件。
当发生新日、破产或城镇变废墟等事件时,插件会创建通知并通过 DiscordSRV 异步发送。
Discord 和数据库故障会被隔离,不会影响 Towny 的正常运行。
默认情况下,不需要数据库。
storage:
type: memory
SQLite、MariaDB 和 MySQL 可选项启用,用于持久化事件历史和去重。
## 命令
| 命令 | 描述 |
|---|---|
| `/townyalerts status` | 显示插件、Towny、DiscordSRV、语言和存储状态 |
| `/townyalerts test` | 向 Discord 发送测试通知 |
| `/townyalerts reload` | 重载 TownyAlerts 配置与语言文件 |
| `/townyalerts storage status` | 显示当前存储后端状态 |
| `/townyalerts storage test` | 测试配置的存储连接 |
## 权限
| 权限节点 | 描述 | 默认值 |
|---|---|---|
| `townyalerts.admin` | 允许访问所有 TownyAlerts 管理命令 | OP |
## 依赖要求
- Towny
- DiscordSRV
- Java 17 或更高版本(具体取决于你的 Minecraft 服务器版本)
TownyAlerts 基于 Towny 当前支持的 Minecraft 版本范围设计,涵盖 **1.19.x 至 26.2.x**。
当前的兼容性重点针对 **Paper 和 Purpur**。
## 语言设置
在 `config.yml` 中设置语言:
```yaml
language: "en"
示例:
en
en-us
es
es-cl
es-mx
fr
fr-ca
en-uk
语言标识符不区分大小写。
可以将自定义语言文件添加到以下目录:
plugins/TownyAlerts/languages/
缺失的翻译会自动回退到 en-us。

TownyAlerts is a lightweight community plugin created by DynaDev that listens to official Towny events and sends administrative alerts directly to Discord through DiscordSRV.
It does not modify Towny, taxes, upkeep, towns, nations or player balances. TownyAlerts works only as an observer and notification layer.
Features
- Daily Towny New Day summaries
- Town bankruptcy alerts
- Town ruin alerts
- Fallen town and nation notifications
- Missed New Day detection after server/plugin downtime
- Discord messages through the existing DiscordSRV bot
- Separate Discord channels per event type
- Dynamic language system
- Included languages:
en-us — American English
es-cl — Latin American Spanish
- Custom community language files supported
- Optional storage:
- Memory
- SQLite
- MariaDB
- MySQL
- Persistent event deduplication
- No telemetry
- No update checker
- No Discord webhook or additional bot token required
How it works
TownyAlerts listens to Towny's official Bukkit events.
When events such as a New Day, bankruptcy or ruined town occur, the plugin creates a notification and sends it asynchronously through DiscordSRV.
Discord and database failures are isolated and will not interfere with Towny's normal operation.
By default, no database is required.
storage:
type: memory
SQLite, MariaDB and MySQL can optionally be enabled for persistent event history and deduplication.
## Commands
| Command | Description |
|---|---|
| `/townyalerts status` | Shows plugin, Towny, DiscordSRV, language and storage status |
| `/townyalerts test` | Sends a test notification to Discord |
| `/townyalerts reload` | Reloads TownyAlerts configuration and languages |
| `/townyalerts storage status` | Shows the current storage backend status |
| `/townyalerts storage test` | Tests the configured storage connection |
## Permissions
| Permission | Description | Default |
|---|---|---|
| `townyalerts.admin` | Allows access to all TownyAlerts administrative commands | OP |
## Requirements
- Towny
- DiscordSRV
- Java 17 or newer, depending on your Minecraft server version
TownyAlerts is designed around Towny's current Minecraft support range from **1.19.x through 26.2.x**.
Current compatibility is focused on **Paper and Purpur**.
## Languages
Set the language in `config.yml`:
```yaml
language: "en"
Examples:
en
en-us
es
es-cl
es-mx
fr
fr-ca
en-uk
Language identifiers are case-insensitive.
Custom language files can be added to:
plugins/TownyAlerts/languages/
Missing translations automatically fall back to en-us.
评论 0
登录后参与评分
还没有评论,来抢沙发吧