/** * The Studio: Artist of the Day Plugin * This is a daily activity where users get to nominate an artist to be Artist of the day, and it's randomly selected * Only works in a room with the id "thestudio" */ exports.commands = { startaotd: function () { return this.parse('/toggleaotd on'); }, endaotd: function () { return this.parse('/toggleaotd off'); }, taotd: 'toggleaotd', toggleaotd: function (target, room, user) { if (room.id !== 'thestudio') return this.sendReply("This command can only be used in The Studio."); if (!this.canTalk()) return; if (!this.can('mute', null, room)) return; if (!target) { return this.sendReply("/toggleaotd [on / off] - If on, this will start AOTD, if off, this will no longer allow people to use /naotd."); } if (target === 'on') { if (room.aotdOn) return this.sendReply("The Artist of the Day has already started."); room.addRaw( '
' + '

Artist of the Day has started!

' + "

(Started by " + Tools.escapeHTML(user.name) + ")

" + "

Use /naotd [artist] to nominate an artist!

" + '
' ); room.aotdOn = true; this.logModCommand("Artist of the Day was started by " + Tools.escapeHTML(user.name) + "."); } if (target === 'off') { if (!room.aotdOn) return this.sendReply("The Artist of the Day has already ended."); room.addRaw("Nominations are over! (Turned off by " + Tools.escapeHTML(user.name) + ")"); room.aotdOn = false; } }, aotdfaq: 'aotdhelp', aotdhelp: function (target, room) { if (!this.canBroadcast()) return; if (room.id !== 'thestudio') return this.sendReply("This command can only be used in The Studio."); this.sendReplyBox( "

Artist of the Day:

" + "

This is a room activity for The Studio where users nominate artists for the title of 'Artist of the Day'.

" + '

' + "Command List:" + '

' + '

' + "

More information on Artist of the Day and these commands.

" ); }, nominateartistoftheday: 'naotd', naotd: function (target, room, user) { if (room.id !== 'thestudio') return this.sendReply("This command can only be used in The Studio."); if (!room.aotdOn) return this.sendReply("The Artist of the Day has already been chosen."); if (!target) return this.sendReply("/naotd [artist] - Nominates an artist for Artist of the Day."); if (target.length > 25) return this.sendReply("This Artist's name is too long; it cannot exceed 25 characters."); if (!this.canTalk()) return; room.addRaw(Tools.escapeHTML(user.name) + "'s nomination for Artist of the Day is: " + Tools.escapeHTML(target) + ""); }, artistoftheday: 'aotd', aotd: function (target, room, user) { if (room.id !== 'thestudio') return this.sendReply("This command can only be used in The Studio."); if (!target) { if (!this.canBroadcast()) return; this.sendReplyBox("The current Artist of the Day is: " + Tools.escapeHTML(room.aotd) + ""); return; } if (!this.canTalk()) return; if (target.length > 25) return this.sendReply("This Artist\'s name is too long; it cannot exceed 25 characters."); if (!this.can('mute', null, room)) return; room.aotd = target; room.addRaw( '
' + "

The Artist of the Day is now " + Tools.escapeHTML(target) + "

" + "

(Set by " + Tools.escapeHTML(user.name) + ".)

" + "

This Artist will be posted on our Artist of the Day page.

" + '
' ); room.aotdOn = false; this.logModCommand("The Artist of the Day was changed to " + Tools.escapeHTML(target) + " by " + Tools.escapeHTML(user.name) + "."); } };