mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-09 04:23:45 -05:00
Mastermind: Support category aliases
This commit is contained in:
parent
008cfec4c3
commit
6628bb9d36
|
|
@ -2511,12 +2511,14 @@ const mastermindCommands: Chat.ChatCommands = {
|
|||
this.checkChat();
|
||||
const game = getMastermindGame(room);
|
||||
|
||||
const [category, timeoutString, player] = target.split(',').map(toID);
|
||||
let [category, timeoutString, player] = target.split(',').map(toID);
|
||||
if (!player) return this.parse(`/help mastermind start`);
|
||||
|
||||
category = CATEGORY_ALIASES[category] || category;
|
||||
if (!(category in ALL_CATEGORIES)) {
|
||||
return this.errorReply(this.tr`${category} is not a valid category.`);
|
||||
}
|
||||
const categoryName = ALL_CATEGORIES[CATEGORY_ALIASES[category] || category];
|
||||
const categoryName = ALL_CATEGORIES[category];
|
||||
const timeout = parseInt(timeoutString);
|
||||
if (isNaN(timeout) || timeout < 1 || (timeout * 1000) > Chat.MAX_TIMEOUT_DURATION) {
|
||||
return this.errorReply(this.tr`You must specify a round length of at least 1 second.`);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user