Skip to content

Commit

Permalink
Don't error on unknown buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-rifkin committed Aug 11, 2024
1 parent 1bd02e6 commit 39b74e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/wheatley.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1248,8 +1248,9 @@ export class Wheatley {
}
} else if (interaction.isButton()) {
// TODO: permissions
assert(interaction.customId in this.other_commands);
await this.other_commands[interaction.customId].handler(interaction);
if (interaction.customId in this.other_commands) {
await this.other_commands[interaction.customId].handler(interaction);
}
}
// TODO: Notify if errors occur in the handler....
} catch (e) {
Expand Down

0 comments on commit 39b74e3

Please sign in to comment.