From d1970d22623f374b1ce48d11afca015bc928ea26 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Fri, 28 Feb 2020 14:07:14 -0500 Subject: [PATCH] Clean up --- commands/util/report.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/commands/util/report.js b/commands/util/report.js index b9dda372..2e8d826e 100644 --- a/commands/util/report.js +++ b/commands/util/report.js @@ -45,15 +45,22 @@ module.exports = class ReportCommand extends Command { const channel = await this.client.channels.fetch(REPORT_CHANNEL_ID); await channel.send({ embed }); } catch (err) { - for (const owner of this.client.owners) { - try { - await owner.send({ embed }); - } catch (err) { - continue; - } - } + await this.sendOwnerDM(embed); } + } else { + await this.sendOwnerDM(embed); } return msg.say(`${displayReasons[reason]} sent! Thank you!`); } + + async sendOwnerDM(embed) { + for (const owner of this.client.owners) { + try { + await owner.send({ embed }); + } catch (err) { + continue; + } + } + return null; + } };