From f7435afef01036fb6f469beecd6df71e741dc833 Mon Sep 17 00:00:00 2001 From: jacoobes Date: Fri, 11 Feb 2022 10:08:55 -0600 Subject: [PATCH] fixed bug, line 128 --- src/handler/sern.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/handler/sern.ts b/src/handler/sern.ts index 8629221..2bc3e19 100644 --- a/src/handler/sern.ts +++ b/src/handler/sern.ts @@ -29,7 +29,7 @@ export class Handler { **/ .on("ready", async () => { Files.buildData(this) - .then(this.registerModules); + .then( data => this.registerModules(data)) if (wrapper.init !== undefined) wrapper.init(this); }) @@ -114,7 +114,7 @@ export class Handler { absPath: string }[] ) { - for (const { name, mod, absPath } of modArr) { + for await (const { name, mod, absPath } of modArr) { const { cmdName, testOnly } = Files.fmtFileName(name); switch (mod.type) { case 1: Files.Commands.set(cmdName, { mod, options: [], testOnly }); break; @@ -125,11 +125,11 @@ export class Handler { switch (mod.visibility) { case "private": { // loading guild slash commands only - await this.reloadSlash(cmdName, mod.desc, options) + await this.reloadSlash(cmdName, mod.desc, options) } case "public": { // creating global commands! - this.client.application!.commands + await this.client.application!.commands .create({ name: cmdName, description: mod.desc, @@ -138,7 +138,7 @@ export class Handler { } } } break; - default: throw Error(`${name}.js is not a valid module type.`); + default: throw Error(`${name} with ${mod.visibility} is not a valid module type.`); } if (mod.alias.length > 0) { @@ -158,7 +158,7 @@ export class Handler { cmdName: string, description: string, options: ApplicationCommandOptionData[] - ) { + ) : Promise { for (const { id } of this.privateServers) { const guild = (await this.client.guilds.fetch(id));