From b45fd195df8c60261a3d63edf343d864f4b6112a Mon Sep 17 00:00:00 2001 From: Snipzil Date: Wed, 21 Oct 2026 22:54:27 -0400 Subject: [PATCH] fix(discord-bot): the public status card counts the players online MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit publishStatus gave the card players: 0 and rooms: 0, so the public card always said "0 online • 0 rooms". It now counts world.players() and their rooms, as /burrow status does. Co-Authored-By: Claude Opus 5.5 --- lib/discordbot.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/discordbot.js b/lib/discordbot.js index bf48e81..cc8dde4 100644 --- a/lib/discordbot.js +++ b/lib/discordbot.js @@ -597,7 +597,9 @@ const postCard = async (channelId, payload, label) => { const publishStatus = async () => { const channel = await channelFor(config.discord.statusChannelId); if (!channel) return {error: "The public status channel is not configured or the Discord bot is not connected."}; - const payload = statusCard({players: 0, rooms: 0, reports: reports.openCount(), uptimeSeconds: Math.floor(process.uptime()), memoryMb: Math.round(process.memoryUsage().rss / 1048576)}); + const players = world.players(); + const payload = statusCard({players: players.length, rooms: new Set(players.map(player => player.room).filter(Boolean)).size, + reports: reports.openCount(), uptimeSeconds: Math.floor(process.uptime()), memoryMb: Math.round(process.memoryUsage().rss / 1048576)}); // The public status card needs no staff actor; it exposes only aggregate // counts. Store its message id in the server database so restarts edit it. const saved = accounts.setting(STATUS_MESSAGE_SETTING);