mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-03-22 01:35:31 -05:00
Implement /viewquote last (#9952)
This commit is contained in:
parent
b3cda4b01d
commit
a1ced8d4b3
|
|
@ -106,7 +106,7 @@ export const commands: Chat.ChatCommands = {
|
|||
const roomQuotes = quotes[room.roomid];
|
||||
if (!roomQuotes?.length) return this.errorReply(`This room has no quotes.`);
|
||||
const [num, showAuthor] = Utils.splitFirst(target, ',');
|
||||
const index = parseInt(num) - 1;
|
||||
const index = num === 'last' ? roomQuotes.length - 1 : parseInt(num) - 1;
|
||||
if (isNaN(index)) {
|
||||
return this.errorReply(`Invalid index.`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user