Archived
slash register test
This commit is contained in:
1 parent
861faec976
commit
ceaa0dd803
5 files changed
+28
-3
No files matched your search
@@ -54,6 +54,9 @@ export class Command {
|
||||
this.guilds = options.guilds || [];
|
||||
this.visible = options.visible != undefined ? options.visible : true;
|
||||
this.function = options.function;
|
||||
/*if (!new RegExp("^[w-]{1,32}$").test(this.name)) {
|
||||
throw new Error(`Incorrect command name: ${this.name}`);
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,6 +97,14 @@ export class Command {
|
||||
}
|
||||
}
|
||||
|
||||
toCommandObject() {
|
||||
return {
|
||||
name: this.name,
|
||||
description: this.description,
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
private static processPhrase(phrase?: string | string[]): string[] {
|
||||
if (Array.isArray(phrase)) {
|
||||
const buff = phrase.map((p) => {
|
||||
|
||||
Reference in new issue
Block a user