Skip to content

Commit 94cb14e

Browse files
committed
Add a mass help command for /randtopic
1 parent 157ecb4 commit 94cb14e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

server/chat-commands/info.ts

+12-1
Original file line numberDiff line numberDiff line change
@@ -2999,13 +2999,19 @@ export const commands: Chat.ChatCommands = {
29992999
this.runBroadcast();
30003000
this.sendReply(Utils.html`|html|<div class="broadcast-blue">${Utils.randomElement(room.settings.topics)}</div>`);
30013001
},
3002+
randtopichelp: [
3003+
`/randtopic - Randomly selects a topic from the room's discussion topic pool and displays it.`,
3004+
`/addtopic [target] - Adds the [target] to the pool of random discussion topics. Requires: % @ # &`,
3005+
`/removetopic [index] - Removes the topic from the room's topic pool. Requires: % @ # &`,
3006+
`/randomtopics - View the discussion topic pool for the current room.`,
3007+
],
30023008

30033009
addtopic(target, room, user) {
30043010
room = this.requireRoom();
30053011
this.checkCan('mute', null, room);
30063012
target = target.trim();
30073013
if (!toID(target).length) {
3008-
return this.parse(`/help addtopic`);
3014+
return this.parse(`/help randtopic`);
30093015
}
30103016
if (!room.settings.topics) room.settings.topics = [];
30113017
room.settings.topics.push(target);
@@ -3018,6 +3024,9 @@ export const commands: Chat.ChatCommands = {
30183024
removetopic(target, room, user) {
30193025
room = this.requireRoom();
30203026
this.checkCan('mute', null, room);
3027+
if (!toID(target)) {
3028+
return this.parse(`/help randtopic`);
3029+
}
30213030
const index = Number(toID(target)) - 1;
30223031
if (isNaN(index)) {
30233032
return this.errorReply(`Invalid topic index: ${target}. Must be a number.`);
@@ -3032,6 +3041,8 @@ export const commands: Chat.ChatCommands = {
30323041
},
30333042
removetopichelp: [`/removetopic [index] - Removes the topic from the room's topic pool. Requires: % @ # &`],
30343043

3044+
listtopics: 'randomtopics',
3045+
randtopics: 'randomtopics',
30353046
randomtopics(target, room, user) {
30363047
room = this.requireRoom();
30373048
return this.parse(`/join view-topics-${room}`);

0 commit comments

Comments
 (0)