Node.js + TypeScript service to receive Arma Reforger Server Admin Tools webhooks and route them to a Discord bot. This iteration focuses on structure, receiving the /events payload, and logging each event type.
- Node.js 18+
- npm
npm installnpm run dev— start in watch mode with ts-node-dev.npm run build— type-check and emit todist/.npm start— run the built server fromdist/.
See docs/api.md for detailed reference and examples.
Accepts the webhook body from the Server Admin Tools mod. The server attempts to parse JSON even when the mod sends application/x-www-form-urlencoded.
Expected shape:
{
"token": "mytoken",
"events": [
{
"name": "serveradmintools_player_killed",
"title": "Player Killed",
"data": { "player": "not bacon", "instigator": "not bacon", "friendly": 0 },
"timestamp": 1693589140
}
]
}Response:
{ "received": 1, "recognized": 1 }Simple health check.
- Collection:
postman/ServerAdminToolsDiscordBot.postman_collection.json - Environment:
postman/ServerAdminToolsDiscordBot.postman_environment.json(definesbaseUrl, defaulthttp://localhost:3000).
/set_default_channel— choose the default text channel./set_event_channel— map a specific event to a channel./setup_event_channels— create a category plus one text channel per event and link them automatically. RequiresDISCORD_APP_IDandDISCORD_TOKENin.env.
- SQLite (default
./data/bot.sqlite, override withDB_PATH). - Per-guild isolation: mappings keyed by guild_id.
DISCORD_PRIMARY_GUILD_IDselects which guild receives webhook event posts.
serveradmintools_player_joinedserveradmintools_player_killedserveradmintools_game_startedserveradmintools_game_endedserveradmintools_vote_startedserveradmintools_vote_endedserveradmintools_server_fps_lowserveradmintools_admin_actionserveradmintools_conflict_base_captured
- serveradmintools_admin_action
- serveradmintools_conflict_base_captured
- serveradmintools_game_ended
- serveradmintools_game_started
- serveradmintools_player_joined
- serveradmintools_player_killed
- serveradmintools_server_fps_low
- serveradmintools_vote_ended
- serveradmintools_vote_started
- Wire Discord client and per-event handling logic once event scripts are provided.
- Add validation for event payload shapes and token checking.
- Add tests around /events parsing and logging.