Skip to content
This repository was archived by the owner on Jul 17, 2020. It is now read-only.

Commit dae9479

Browse files
committed
1-based indexing for listcommands.
1 parent 011c57c commit dae9479

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/commands.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ return function ( args ) {
263263
partitioned = partition( commands, maxSize ),
264264

265265
valid = /^(\d+|$)/.test( args.content ),
266-
page = Number( args.content ) || 0;
266+
page = (Number( args.content ) - 1) || 0;
267267

268268
if ( page >= partitioned.length || !valid ) {
269269
return args.codify( [
@@ -276,7 +276,7 @@ return function ( args ) {
276276

277277
var ret = partitioned[ page ].join( ', ' );
278278

279-
return ret + pagination.supplant( page, partitioned.length-1 );
279+
return ret + pagination.supplant( (page + 1), partitioned.length );
280280
};
281281
})();
282282

@@ -491,7 +491,7 @@ var descriptions = {
491491
' `/help [cmdName]`',
492492
info : 'Grabs some stats on my current instance or a command.' +
493493
' `/info [cmdName]`',
494-
listcommands : 'Lists commands. `/listcommands [page=0]`',
494+
listcommands : 'Lists commands. `/listcommands [page=1]`',
495495
listen : 'Forwards the message to my ears (as if called without the /)',
496496
live : 'Resurrects me (:D) if I\'m down (D:)',
497497
parse : 'Returns result of "parsing" message according to the my mini' +

0 commit comments

Comments
 (0)