Skip to content

Commit

Permalink
Workaround for "Unknown interaction" errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Seefaaa authored Jul 23, 2024
1 parent da953fe commit eaa011a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/events/interactionCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ import { get } from '../utils';
export class InteractionCreateEvent implements Event {
public name = Events.InteractionCreate;
public async execute(interaction: CommandInteraction) {
if (interaction.isChatInputCommand()) {
await handleChatInputCommand(interaction);
} else if (interaction.isAutocomplete()) {
await handleAutocomplete(interaction);
try {
if (interaction.isChatInputCommand()) {
await handleChatInputCommand(interaction);
} else if (interaction.isAutocomplete()) {
await handleAutocomplete(interaction);
}
} catch (error) {
interaction.client.logger.error(error);
}
}
}
Expand Down

0 comments on commit eaa011a

Please sign in to comment.