From 131b954c82d780dd84e31df9ebc4f49a2fc1aa79 Mon Sep 17 00:00:00 2001 From: Denys Date: Thu, 22 Feb 2024 17:59:28 -0800 Subject: [PATCH] [fix] Failed to get application_commands for command settings --- src/command.ts | 3 +-- src/midjourney.ts | 6 ------ 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/command.ts b/src/command.ts index 89b08b9..4c4af41 100644 --- a/src/command.ts +++ b/src/command.ts @@ -48,8 +48,7 @@ export class Command { type: "1", include_applications: "true", }); - const url = `${this.config.DiscordBaseUrl}/api/v9/channels/${this.config.ChannelId}/application-commands/search?${searchParams}`; - + const url = `${this.config.DiscordBaseUrl}/api/v9/guilds/${this.config.ServerId}/application-command-index`; const response = await this.config.fetch(url, { headers: { authorization: this.config.SalaiToken }, }); diff --git a/src/midjourney.ts b/src/midjourney.ts index e3fb4e6..2af0584 100644 --- a/src/midjourney.ts +++ b/src/midjourney.ts @@ -35,12 +35,6 @@ export class Midjourney extends MidjourneyMessage { if (!this.config.Ws) { return this; } - //if auth failed, will throw error - if (this.config.ServerId) { - await this.MJApi.getCommand("settings"); - } else { - await this.MJApi.allCommand(); - } if (this.wsClient) return this; this.wsClient = new WsMessage(this.config, this.MJApi); await this.wsClient.onceReady();