@@ -2999,13 +2999,19 @@ export const commands: Chat.ChatCommands = {
2999
2999
this . runBroadcast ( ) ;
3000
3000
this . sendReply ( Utils . html `|html|<div class="broadcast-blue">${ Utils . randomElement ( room . settings . topics ) } </div>` ) ;
3001
3001
} ,
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
+ ] ,
3002
3008
3003
3009
addtopic ( target , room , user ) {
3004
3010
room = this . requireRoom ( ) ;
3005
3011
this . checkCan ( 'mute' , null , room ) ;
3006
3012
target = target . trim ( ) ;
3007
3013
if ( ! toID ( target ) . length ) {
3008
- return this . parse ( `/help addtopic ` ) ;
3014
+ return this . parse ( `/help randtopic ` ) ;
3009
3015
}
3010
3016
if ( ! room . settings . topics ) room . settings . topics = [ ] ;
3011
3017
room . settings . topics . push ( target ) ;
@@ -3018,6 +3024,9 @@ export const commands: Chat.ChatCommands = {
3018
3024
removetopic ( target , room , user ) {
3019
3025
room = this . requireRoom ( ) ;
3020
3026
this . checkCan ( 'mute' , null , room ) ;
3027
+ if ( ! toID ( target ) ) {
3028
+ return this . parse ( `/help randtopic` ) ;
3029
+ }
3021
3030
const index = Number ( toID ( target ) ) - 1 ;
3022
3031
if ( isNaN ( index ) ) {
3023
3032
return this . errorReply ( `Invalid topic index: ${ target } . Must be a number.` ) ;
@@ -3032,6 +3041,8 @@ export const commands: Chat.ChatCommands = {
3032
3041
} ,
3033
3042
removetopichelp : [ `/removetopic [index] - Removes the topic from the room's topic pool. Requires: % @ # &` ] ,
3034
3043
3044
+ listtopics : 'randomtopics' ,
3045
+ randtopics : 'randomtopics' ,
3035
3046
randomtopics ( target , room , user ) {
3036
3047
room = this . requireRoom ( ) ;
3037
3048
return this . parse ( `/join view-topics-${ room } ` ) ;
0 commit comments