diff --git a/server/chat-plugins/daily-spotlight.ts b/server/chat-plugins/daily-spotlight.ts index c8bb39ec37..26168cfdfb 100644 --- a/server/chat-plugins/daily-spotlight.ts +++ b/server/chat-plugins/daily-spotlight.ts @@ -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(`
Random spotlight: ${Utils.escapeHTML(key)}
${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) {