From d11c2dcf0a12cff8ee09c34c7c71360b292a661b Mon Sep 17 00:00:00 2001 From: OrigamingWasTaken Date: Sun, 26 Nov 2023 13:30:59 +0100 Subject: [PATCH] Added channel permissions check --- src/alerts/hander.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/alerts/hander.ts b/src/alerts/hander.ts index 38c88df..51fe15b 100644 --- a/src/alerts/hander.ts +++ b/src/alerts/hander.ts @@ -38,6 +38,10 @@ export async function alert(data: EventAlert, client: Client) { .setLabel("Aller à l'annonce") const row = new ActionRowBuilder() .addComponents(button) - channel.send({content: server.roles ? server.roles.map(role => `<@&${role}>`).join(" ") : "@here",embeds: [embed], components: [row]}) + try { + channel.send({content: server.roles ? server.roles.map(role => `<@&${role}>`).join(" ") : "@here",embeds: [embed], components: [row]}) + } catch (err) { + // Missing permissions in channel + } }) } \ No newline at end of file