mirror of
https://github.com/sern-handler/handler
synced 2026-06-18 05:42:15 +00:00
changed test-commands
This commit is contained in:
@@ -81,9 +81,11 @@ export class Handler {
|
||||
if (module?.mod === undefined) return "Unknown legacy command";
|
||||
|
||||
if (module.mod.visibility === "private") {
|
||||
const checkTest = this.privateServers.find(({id}) => id === message.guildId!)?.test;
|
||||
if(checkTest === undefined) return "This command has the private modifier but is not registered under Handler#privateServers";
|
||||
|
||||
const checkIsTestServer = this.privateServers.find(({id}) => id === message.guildId!)?.test;
|
||||
if(checkIsTestServer === undefined) return "This command has the private modifier but is not registered under Handler#privateServers";
|
||||
if(checkIsTestServer !== module.testOnly) {
|
||||
return "This private command is a testing command";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,9 +25,8 @@ async function readPath(dir: string, arrayOfFiles: string[] = []): Promise<strin
|
||||
}
|
||||
|
||||
const fmtFileName = (n : string) => {
|
||||
return n
|
||||
.toLowerCase()
|
||||
.endsWith("-test.js")
|
||||
const endsW = n.toLowerCase().endsWith("-test.js") || n.toLowerCase().endsWith("-test.ts");
|
||||
return endsW
|
||||
? { cmdName : n.substring(0, n.length - 8), testOnly : true }
|
||||
: { cmdName: n.substring(0, n.length - 3), testOnly: false};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user