@@ -31,14 +31,17 @@ export const command: PSCommand = {
3131
3232 const otherCommands : PSCommand [ ] = [ ] ;
3333
34- const groupedCommands = visibleCommands . reduce < Record < string , PSCommand [ ] > > ( ( grouped , command ) => {
35- if ( command . categories . length > 0 ) {
36- command . categories . forEach ( category => ( grouped [ category ] ??= [ ] ) . push ( command ) ) ;
37- } else {
38- otherCommands . push ( command ) ;
39- }
40- return grouped ;
41- } , { } ) ;
34+ const groupedCommands = visibleCommands . reduce < Record < string , PSCommand [ ] > > (
35+ ( grouped , command ) => {
36+ if ( command . categories . length > 0 ) {
37+ command . categories . forEach ( category => ( grouped [ category ] ??= [ ] ) . push ( command ) ) ;
38+ } else {
39+ otherCommands . push ( command ) ;
40+ }
41+ return grouped ;
42+ } ,
43+ { utility : [ ] , points : [ ] , game : [ ] , casual : [ ] }
44+ ) ;
4245
4346 message . author . sendHTML (
4447 < div className = "infobox" >
@@ -48,16 +51,17 @@ export const command: PSCommand = {
4851 </ p >
4952 < hr />
5053 { [
51- ...Object . entries ( groupedCommands )
52- . map ( ( [ key , commands ] ) => [ titleCase ( key ) , commands ] as [ string , PSCommand [ ] ] )
53- . sortBy ( ( [ key ] ) => key ) ,
54+ ...Object . entries ( groupedCommands ) . map ( ( [ key , commands ] ) => [ titleCase ( key ) , commands ] as [ string , PSCommand [ ] ] ) ,
5455 [ 'Other' , otherCommands ] as [ string , PSCommand [ ] ] ,
5556 ]
5657 . filter ( ( [ _key , commands ] ) => commands . length > 0 )
5758 . map ( ( [ key , commands ] ) => (
5859 < details >
5960 < summary style = { { marginBottom : 4 } } > { key } Commands</ summary >
60- { commands . map ( command => < b title = { command . help ?? undefined } > { command . name } </ b > ) . space ( ', ' ) }
61+ { commands
62+ . sortBy ( command => command . name )
63+ . map ( command => < b title = { command . help ?? undefined } > { command . name } </ b > )
64+ . space ( ', ' ) }
6165 </ details >
6266 ) )
6367 . space ( < hr /> ) }
0 commit comments