From e375fb26315260eca3949bab1c8669f4edcdcc82 Mon Sep 17 00:00:00 2001 From: CL TheDreWen Date: Mon, 3 Nov 2025 13:38:51 +0100 Subject: [PATCH] fix(live_status): handle errors when sending messages to the channel --- src/commands/utility/live_status.command.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/commands/utility/live_status.command.ts b/src/commands/utility/live_status.command.ts index 56392b9..b0d900b 100644 --- a/src/commands/utility/live_status.command.ts +++ b/src/commands/utility/live_status.command.ts @@ -26,7 +26,13 @@ const cmd : CommandDefinition = { const channel = await interaction.guild?.channels.fetch(channel_options?.id); if(channel?.isSendable()) { - const message = await channel.send({components: [statusService.getUpdatedContainer(true)], flags: [MessageFlags.IsComponentsV2]}); + let message; + try { + message = await channel.send({components: [statusService.getUpdatedContainer(true)], flags: [MessageFlags.IsComponentsV2]}); + } catch (error) { + await interaction.reply({content: 'An error has occurred. Please check the permissions for the channel.', flags: [MessageFlags.Ephemeral]}); + return; + } try { const guildRepo = AppDataSource.getRepository(Guild);