From fe46c903c587bf0a277953ecbe34a60d924b2a70 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Thu, 16 Jul 2020 20:27:25 -0400 Subject: [PATCH] Catch errors --- commands/util/report-respond.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/commands/util/report-respond.js b/commands/util/report-respond.js index 868dba22..7a98b63a 100644 --- a/commands/util/report-respond.js +++ b/commands/util/report-respond.js @@ -46,7 +46,11 @@ module.exports = class ReportRespondCommand extends Command { .setFooter(`ID: ${msg.author.id}`) .setTimestamp() .setColor(typesColors[type]); - await user.send('Your report has been evaluated with the following message:', { embed }); - return msg.say(`${displaytypes[type]} sent to ${user.tag}.`); + try { + await user.send('Your report has been evaluated with the following message:', { embed }); + return msg.say(`${displaytypes[type]} sent to ${user.tag}.`); + } catch { + return msg.say(`Could not send ${displaytypes[type]} to ${user.tag}. Probably blocked me.`); + } } };