@@ -374,6 +374,17 @@ function SSBSets(target: string) {
374
374
return buf ;
375
375
}
376
376
377
+
378
+ export const disabledSets = Chat . oldPlugins . ssb ?. disabledSets || [ ] ;
379
+
380
+ function enforceDisabledSets ( ) {
381
+ for ( const process of Rooms . PM . processes ) {
382
+ process . getProcess ( ) . send ( `EVAL\n\nConfig.disabledssbsets = ${ JSON . stringify ( disabledSets ) } ` ) ;
383
+ }
384
+ }
385
+
386
+ enforceDisabledSets ( ) ;
387
+
377
388
export const commands : Chat . ChatCommands = {
378
389
ssb ( target , room , user ) {
379
390
if ( ! this . runBroadcast ( ) ) return ;
@@ -387,4 +398,27 @@ export const commands: Chat.ChatCommands = {
387
398
ssbhelp : [
388
399
`/ssb [staff member] - Displays a staff member's Super Staff Bros. set and custom features.` ,
389
400
] ,
401
+ enablessbset : 'disablessbset' ,
402
+ disablessbset ( target , room , user , connection , cmd ) {
403
+ this . checkCan ( 'rangeban' ) ;
404
+ target = toID ( target ) ;
405
+ if ( ! Object . keys ( ssbSets ) . map ( toID ) . includes ( target as ID ) ) {
406
+ throw new Chat . ErrorMessage ( `${ target } has no SSB set.` ) ;
407
+ }
408
+ const disableIdx = disabledSets . indexOf ( target ) ;
409
+ if ( cmd . startsWith ( 'enable' ) ) {
410
+ if ( disableIdx < 0 ) {
411
+ throw new Chat . ErrorMessage ( `${ target } 's set is not disabled.` ) ;
412
+ }
413
+ disabledSets . splice ( disableIdx , 1 ) ;
414
+ this . privateGlobalModAction ( `${ user . name } enabled ${ target } 's SSB set.` ) ;
415
+ } else {
416
+ if ( disableIdx > - 1 ) {
417
+ throw new Chat . ErrorMessage ( `That set is already disabled.` ) ;
418
+ }
419
+ disabledSets . push ( target ) ;
420
+ this . privateGlobalModAction ( `${ user . name } disabled the SSB set for ${ target } ` ) ;
421
+ }
422
+ enforceDisabledSets ( ) ;
423
+ } ,
390
424
} ;
0 commit comments