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);