From 449d5c1cc4ed8360fd22404ab27679c49afed918 Mon Sep 17 00:00:00 2001 From: xswl Date: Tue, 4 Jul 2023 01:33:07 +0800 Subject: [PATCH] fix command --- src/command.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/command.ts b/src/command.ts index 5506ab7..7b08b17 100644 --- a/src/command.ts +++ b/src/command.ts @@ -35,9 +35,13 @@ export class Command { if (this.cache[name] !== undefined) { return this.cache[name]; } - const command = await this.getCommand(name); - this.cache[name] = command; - return command; + if (this.config.ServerId){ + const command = await this.getCommand(name); + this.cache[name] = command; + return command; + } + this.allCommand(); + return this.cache[name]; } async allCommand() { const searchParams = new URLSearchParams({ @@ -67,7 +71,7 @@ export class Command { query: name, limit: "1", include_applications: "true", - command_ids: `${this.config.BotId}`, + // command_ids: `${this.config.BotId}`, }); const url = `${this.config.DiscordBaseUrl}/api/v9/channels/${this.config.ChannelId}/application-commands/search?${searchParams}`; const response = await this.config.fetch(url, {