
CaptainHook
Adds chat-to-server integration with Discord, online player tracking, uptime stats, and full web analytics — all fully configurable.
By Caenos
CHANGELOG
CaptainHook - Valheim Discord Bridge Version: 4.0.0 by Caenos
🌩️ What is CaptainHook? CaptainHook is a lightweight, server-side mod that lets you connect your Valheim server to a Discord bot—delivering real-time info about players, server status, uptime, and more, all over a secure HTTP interface.
This update brings full per-command toggling via config, on-the-fly reloading, and smooth multi-server Discord integration. Built for ease of use and reliability—no log file scraping, no messy dependencies, and zero downtime for config changes!
✨ New in v4.0.0 🔄 Live Config Reload: Change your mod config and use the new /reload endpoint—no need to restart your server to update which commands are enabled.
⚙️ Per-Endpoint Toggles: Enable or disable any HTTP endpoint (/stats, /uptime, /version, /whereis, /commands, etc) directly from your config file.
🤖 Multi-Server Ready: Each server runs its own mod and exposes just the endpoints you want; your Discord bot can aggregate all servers and display results as one.
🗂️ Auto-generated Configs: The mod will auto-create Caenos.CaptainHook.cfg, seen.json, and debug.json if they're missing.
🧠 Cleaner API: Removed /day and dashboard endpoints for simplicity and accuracy.
🛡️ Designed for Dedicated Servers: No Valheim client required—just drop in on your server.
✅ Full Discord Slash Command Support (with included example bot).
📦 Installation
- Server Setup Install BepInEx BepInExPack Valheim on Thunderstore
Drop CaptainHook.dll Place CaptainHook.dll into BepInEx/plugins/.
Start your server once. The config file BepInEx/config/Caenos.CaptainHook.cfg will be generated. Edit it to your needs:
ini Copy Edit [General] Port = 25681 BotName = CaptainHook ServerIP = 127.0.0.1
[Endpoints] EnableStats = true EnablePing = true EnableUptime = true EnableVersion = true EnableWhereIs = true EnableCommands = true ; EnableDay = false # /day endpoint is removed in 4.0.0
No server restart needed for config changes! Just hit the /reload endpoint with your bot or browser to re-read the config instantly.
- Discord Bot Integration The mod is designed to work with the provided Python Discord bot template
Each server can run its own instance of CaptainHook, and the bot can fetch stats from all servers (S1, S2, S3, etc) and merge/forward results in Discord
See full example bot code below (supports /stats, /uptime, /whereis, /seen, /version, more...)
🚀 Features 📡 Discord bot support: Real-time stats and slash command integration
🧍 View online players and their biomes (/whereis)
⏱️ Get server uptime
🔗 All endpoints toggleable in config
🛠️ No restarts for config changes
📁 Auto-creates needed config and JSON files
⚡ No log scraping, file sharing, or modded clients needed
✅ Safe for dedicated servers
🤖 Example Discord Bot Commands /stats — Lists all online players from all your servers
/whereis <name> — Shows a player’s biome (per-server)
/uptime — Displays server uptime
/version — Shows mod version and author
/reload — Reloads the mod config on the fly
/seen <name> — When was a player last seen online (Discord-bot only)
/commands — Lists all commands and descriptions
🔒 Security Notes The HTTP server is read-only; it never accepts commands or controls the game/server
For extra safety, use a firewall or reverse proxy to restrict access to your bot’s IP
🙌 Credits Mod developed by Caenos Discord Bot example, testing, and feedback from the community
📂 Source / Repository Coming soon on GitHub...