feat: motd
This commit is contained in:
4
index.ts
4
index.ts
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user