throw exceptions instead of direct replies

This commit is contained in:
Jelle van Snik 2022-05-30 21:31:20 +02:00
parent 088ca51fcd
commit 8b76b06381
2 changed files with 2 additions and 10 deletions

View file

@ -63,11 +63,7 @@ async function modApplicationHandler(interaction) {
const channel = channelId && guild.channels.fetch(channelId);
if (!channel) {
await interaction.editReply({
content: 'application failed to submit - channel not setup!',
ephemeral: true
});
return;
throw new Error('application failed to submit - channel not setup!');
}
const modApplicationEmbed = new Discord.MessageEmbed();

View file

@ -47,11 +47,7 @@ async function reportUserHandler(interaction) {
const reportsChannel = channels.find(channel => channel.id === db.getDB().get('report.channel.log'));
if (!reportsChannel) {
await interaction.editReply({
content: 'Report failed to submit - channel not setup',
ephemeral: true
});
return;
throw new Error('Report failed to submit - channel not setup');
}
const reportEmbed = new Discord.MessageEmbed();