This commit is contained in:
Sergio Garcia 2026-06-02 01:39:12 -06:00 committed by GitHub
commit c2ce4bee82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -298,6 +298,22 @@ export const commands: Chat.ChatCommands = {
}
room.update();
},
randdaily: 'randspotlight',
randspotlight(target, room, user) {
room = this.requireRoom();
if (!room.persist) throw new Chat.ErrorMessage("This command is unavailable in temporary rooms.");
if (!spotlights[room.roomid]) throw new Chat.ErrorMessage("This room has no daily spotlights.");
const keys = Object.keys(spotlights[room.roomid]);
if (!keys.length) throw new Chat.ErrorMessage("This room has no daily spotlights.");
if (!this.runBroadcast()) return;
const key = keys[Math.floor(Math.random() * keys.length)];
const html = renderSpotlight(room.roomid, key);
this.sendReplyBox(`<p><strong>Random spotlight: ${Utils.escapeHTML(key)}</strong></p>${html}`);
},
randspotlighthelp: [
`/randspotlight OR /randdaily - Shows a random spotlight from the target room.`,
`!randspotlight OR !randdaily - Show a random spotlight to everyone. Requires: + % @ # ~`,
],
vsl: 'viewspotlights',
dailies: 'viewspotlights',
viewspotlights(target, room, user) {