Archived
added simple and no_input parameters options
This commit is contained in:
1 parent
80ac62a80f
commit
af390743db
2 files changed
+8
-4
No files matched your search
+7
-3
@@ -48,9 +48,13 @@ export class Command {
|
|||||||
*/
|
*/
|
||||||
constructor(options: CommandBuilder) {
|
constructor(options: CommandBuilder) {
|
||||||
this.name = options.name.split(" ").join("_");
|
this.name = options.name.split(" ").join("_");
|
||||||
this.parameters = options.parameters
|
if (options.parameters == "no_input" || !options.parameters) {
|
||||||
? options.parameters.map((p) => new Parameter(p))
|
this.parameters = [];
|
||||||
: [new DefaultParameter()];
|
} else if (options.parameters == "simple") {
|
||||||
|
this.parameters = [new DefaultParameter()];
|
||||||
|
} else {
|
||||||
|
this.parameters = options.parameters.map((ps) => new Parameter(ps));
|
||||||
|
}
|
||||||
this.aliases = Command.processPhrase(options.aliases);
|
this.aliases = Command.processPhrase(options.aliases);
|
||||||
this.keywords = Command.processPhrase(options.keywords);
|
this.keywords = Command.processPhrase(options.keywords);
|
||||||
this.description = options.description || "No description";
|
this.description = options.description || "No description";
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ export type GetMode = "ALL" | "PREFIX" | "NO_PREFIX";
|
|||||||
export type PermissionCheckTypes = "ALL" | "ANY";
|
export type PermissionCheckTypes = "ALL" | "ANY";
|
||||||
export interface CommandBuilder {
|
export interface CommandBuilder {
|
||||||
name: string;
|
name: string;
|
||||||
parameters?: ParameterSchema[];
|
parameters?: ParameterSchema[] | "simple" | "no_input";
|
||||||
aliases?: string[] | string;
|
aliases?: string[] | string;
|
||||||
keywords?: string[] | string;
|
keywords?: string[] | string;
|
||||||
description?: string;
|
description?: string;
|
||||||
|
|||||||
Reference in new issue
Block a user