File tree Expand file tree Collapse file tree 1 file changed +8
-23
lines changed Expand file tree Collapse file tree 1 file changed +8
-23
lines changed Original file line number Diff line number Diff line change @@ -28,15 +28,6 @@ import { getUsername, getUsernameSync } from '@/lib/util.js';
2828
2929const LB_PAGE_SIZE = 10 ;
3030
31- function lbMsg ( str : string , ironmanOnly ?: boolean ) {
32- return {
33- content : `Showing you the ${ str } leaderboard, click the buttons to change pages.${
34- ironmanOnly ? ' Showing only ironmen.' : ''
35- } `,
36- ephemeral : true
37- } ;
38- }
39-
4031async function bulkGetUsernames ( userIDs : string [ ] ) {
4132 await Promise . all ( uniqueArr ( userIDs ) . map ( id => getUsername ( id ) ) ) ;
4233}
@@ -94,7 +85,13 @@ async function doMenuWrapper({
9485 `${ getPos ( c , i ) } **${ user . full_name ?? ( await getUsername ( user . id ) ) } :** ${ formatter ? formatter ( user . score ) : user . score . toLocaleString ( ) } `
9586 ) ;
9687 const pageText = ( await Promise . all ( unwaited ) ) . join ( '\n' ) ;
97- return { embeds : [ new EmbedBuilder ( ) . setTitle ( title ) . setDescription ( pageText ) ] } ;
88+ return {
89+ embeds : [
90+ new EmbedBuilder ( )
91+ . setTitle ( `${ title } ${ ironmanOnly ? ' (Ironmen Only)' : '' } ` )
92+ . setDescription ( pageText )
93+ ]
94+ } ;
9895 } ;
9996 pages . push ( makePage ) ;
10097 }
@@ -103,19 +100,7 @@ async function doMenuWrapper({
103100 }
104101
105102 return interaction . makePaginatedMessage ( {
106- pages : pages . map ( ( p , i ) => {
107- if ( isFunction ( p ) ) {
108- return p ;
109- }
110-
111- return {
112- embeds : [
113- new EmbedBuilder ( )
114- . setTitle ( `${ lbMsg ( title , ironmanOnly ) . content } (Page ${ i + 1 } /${ pages . length } )` )
115- . setDescription ( p )
116- ]
117- } ;
118- } )
103+ pages
119104 } ) ;
120105}
121106
You can’t perform that action at this time.
0 commit comments