better error handling

This commit is contained in:
SowinskiBraeden committed 2022-08-05 15:34:01 -07:00
1 parent 2aa052b2e2
commit c6ba35796f
4 files changed
+21 -5

No files matched your search

+5 -1
View File
@@ -157,7 +157,11 @@ module.exports = {
return interaction.send({ embeds: [embed] });
}
channel.send({ content: `<@&${GuildDB.dispatcherRole}> New 911 call!`, embeds: [embed911], components: [opt] });
try {
channel.send({ content: `<@&${GuildDB.dispatcherRole}> New 911 call!`, embeds: [embed911], components: [opt] });
} catch (err) {
return interaction.send(`<@${client.user.id}> Does not have permissions to send to the channel.\nMake sure your admins give <@${client.user.id}> access to all channels required. `)
}
return interaction.send('911 Alerted!');
},
},