File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -124,10 +124,15 @@ export async function execute(interaction: ChatInputCommandInteraction) {
124124 } catch ( error ) {
125125 logger . error ( '[NOTIFICATIONS] Error:' , error ) ;
126126 const msg = { content : '❌ An error occurred while handling your notification preferences.' } ;
127- if ( interaction . deferred || interaction . replied ) {
128- await interaction . editReply ( msg ) ;
129- } else {
130- await interaction . reply ( { ...msg , flags : MessageFlags . Ephemeral } ) ;
127+
128+ try {
129+ if ( interaction . deferred || interaction . replied ) {
130+ await interaction . editReply ( msg ) ;
131+ } else {
132+ await interaction . reply ( { ...msg , flags : MessageFlags . Ephemeral } ) ;
133+ }
134+ } catch ( replyError ) {
135+ logger . error ( '[NOTIFICATIONS] Failed to send error response:' , replyError ) ;
131136 }
132137 }
133138}
You can’t perform that action at this time.
0 commit comments