mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-18 17:27:50 -05:00
fix(discord-bot): the public status card counts the players online
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 <[email protected]>
This commit is contained in:
1 parent
e2454447d9
commit
b45fd195df
1 file changed
+3
-1
+3
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user