Skip to content

Commit 929f77c

Browse files
committed
Add logging for autocomplete taking longer than the timeframe to reply to the interaction
1 parent b8e5945 commit 929f77c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/command-handler.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,10 +454,12 @@ export class CommandHandler {
454454
// Note: Legacy buttons (the-button, anti_screenshot_acknowledge, etc.) are handled
455455
// directly by individual components via their on_interaction_create methods
456456
}
457-
// TODO: Notify if errors occur in the handler....
458457
} catch (e) {
459-
// TODO....
460-
this.wheatley.critical_error(e);
458+
if (interaction.isAutocomplete() && e instanceof Discord.DiscordAPIError && e.code === 10062) {
459+
M.warn("Autocomplete interaction expired before response could be sent");
460+
} else {
461+
this.wheatley.critical_error(e);
462+
}
461463
}
462464
}
463465
}

0 commit comments

Comments
 (0)