slash register test

This commit is contained in:
mmacierzanka committed 2021-08-07 02:26:19 +02:00
1 parent 861faec976
commit ceaa0dd803
5 files changed
+28 -3

No files matched your search

+11
View File
@@ -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) => {