feat: motd

This commit is contained in:
2026-03-07 16:50:56 +01:00
parent b1dc4835b3
commit c506108ca8
2 changed files with 51 additions and 2 deletions

View File

@@ -12,6 +12,8 @@ for (const line of lines.slice(1)) {
}
}
const MOTD = process.env.MOTD || "50;";
export let displaySockets: ServerWebSocket<unknown>[] = [];
export async function broadcastDisplayUpdate() {
@@ -111,7 +113,7 @@ Bun.serve({
if(!displaySockets.includes(ws)) {
displaySockets.push(ws);
console.log("Added display socket. Total:", displaySockets.length);
ws.send(JSON.stringify({ type: "display", tickets: await getDisplayTickets() }));
ws.send(JSON.stringify({ type: "display", tickets: await getDisplayTickets(), motd: MOTD }));
}
}
}, // a message is received