Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
zcpua authored Jul 1, 2023
1 parent 856966f commit 15055ed
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,9 @@ export class Command {
});

const data = await response.json();

if ("application_commands" in data) {
const application_commands = data.application_commands;
if (application_commands[0]) {
// console.log(
// `got ${name} application_commands`,
// application_commands[0]
// );
return application_commands[0];
}
if (data?.application_commands?.[0]) {
return data.application_commands[0];
}

throw new Error(`Failed to get application_commands for command ${name}`);
}
async imaginePayload(prompt: string, nonce?: string) {
Expand Down

0 comments on commit 15055ed

Please sign in to comment.