mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-06-02 22:08:36 -05:00
Merge dabbc5c578 into 6765d8422d
This commit is contained in:
commit
c2ce4bee82
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user