publicreadonlyaliases: string[];// This is to keep the array intact for parent Command instances to use. It'll also be used when loading top-level aliases.
publicoriginalCommandName: string|null;// If the command is an alias, what's the original name?
publicreadonlysubcommands: Collection<string,Command>;// This is the final data structure you'll actually use to work with the commands the aliases point to.
// Then loop again to make aliases point to the base subcommands and warn if something's not right.
// This shouldn't be a problem because I'm hoping that JS stores these as references that point to the same object.
for(constnameinoptions.subcommands){
constsubcmd=options.subcommands[name];
subcmd.originalCommandName=name;
constaliases=subcmd.aliases;
for(constaliasofaliases){
if(baseSubcommands.includes(alias))
$.warn(
`"${alias}" in subcommand "${name}" was attempted to be declared as an alias but it already exists in the base commands! (Look at the next "Loading Command" line to see which command is affected.)`,
);
elseif(this.subcommands.has(alias))
$.warn(
`Duplicate alias "${alias}" at subcommand "${name}"! (Look at the next "Loading Command" line to see which command is affected.)`,
);
elsethis.subcommands.set(alias,subcmd);
}
}
}
if(this.user&&this.user.aliases.length>0)
$.warn(
`There are aliases defined for a "user"-type subcommand, but those aliases won't be used. (Look at the next "Loading Command" line to see which command is affected.)`,
);
if(this.number&&this.number.aliases.length>0)
$.warn(
`There are aliases defined for a "number"-type subcommand, but those aliases won't be used. (Look at the next "Loading Command" line to see which command is affected.)`,
);
if(this.any&&this.any.aliases.length>0)
$.warn(
`There are aliases defined for an "any"-type subcommand, but those aliases won't be used. (Look at the next "Loading Command" line to see which command is affected.)`,
description:"This is a template/testing command providing common functionality. Remove what you don't need, and rename/delete this file to generate a fresh command file here. This command should be automatically excluded from the help command. The \\"usage\\" parameter (string) overrides the default usage for the help command. The \\"endpoint\\" parameter (boolean) prevents further arguments from being passed. Also, as long as you keep the run function async, it'll return a promise allowing the program to automatically catch any synchronous errors. However, you'll have to do manual error handling if you go the then and catch route.",
description:"This is a named subcommand, meaning that the key name is what determines the keyword to use. With default settings for example, \\"$testlayer\\".",
description:"This is the subcommand for getting users by pinging them or copying their ID. With default settings for example, \\"$test237359961842253835\\". The argument will be a user object and won't run if no user is found by that ID.",
description:"This is a numeric subcommand, meaning that any type of number (excluding Infinity/NaN) will route to this command if present. With default settings for example, \\"$test-5.2\\". The argument with the number is already parsed so you can just use it without converting it.",
description:"This is a generic subcommand, meaning that if there isn't a more specific subcommand that's called, it falls to this. With default settings for example, \\"$testreeee\\".",