Skip to content

Commit

Permalink
Merge pull request #256 from deniska83/discord-api-fix
Browse files Browse the repository at this point in the history
[fix] Failed to get application_commands for command settings issue #255
  • Loading branch information
zcpua authored Feb 25, 2024
2 parents a7a0125 + 131b954 commit 9badf9a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
3 changes: 1 addition & 2 deletions src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
});
Expand Down
6 changes: 0 additions & 6 deletions src/midjourney.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 9badf9a

Please sign in to comment.