Skip to content

Commit ffe9d86

Browse files
BigMichi1Copilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 2076b2d commit ffe9d86

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/bot/commands/notifications.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)