mirror of
https://github.com/thedrewen/protojx-manager.git
synced 2026-03-21 01:48:54 +01:00
fix(live_status): handle errors when sending messages to the channel
This commit is contained in:
@@ -26,7 +26,13 @@ const cmd : CommandDefinition = {
|
|||||||
const channel = await interaction.guild?.channels.fetch(channel_options?.id);
|
const channel = await interaction.guild?.channels.fetch(channel_options?.id);
|
||||||
|
|
||||||
if(channel?.isSendable()) {
|
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 {
|
try {
|
||||||
const guildRepo = AppDataSource.getRepository(Guild);
|
const guildRepo = AppDataSource.getRepository(Guild);
|
||||||
|
|||||||
Reference in New Issue
Block a user