From 2b5282b19e0bf982b02a17c371671231e026b9e1 Mon Sep 17 00:00:00 2001 From: Isaac Date: Thu, 3 Dec 2020 21:59:41 +0000 Subject: [PATCH] Update close.js --- src/commands/close.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/commands/close.js b/src/commands/close.js index 390cc21..c4bedbe 100644 --- a/src/commands/close.js +++ b/src/commands/close.js @@ -132,7 +132,7 @@ module.exports = { } catch (e) { log.warn(`Could not create DM channel with ${u.tag}`); } - const archive = client.channels.cache.find(ch => ch.id === "") + let res = {}; const embed = new MessageEmbed() @@ -160,13 +160,12 @@ module.exports = { } res.embed = embed; - try { - archive.send(res) - dm.send(res) + dm.send(res); + if (config.logs.discord.enabled) client.channels.cache.get(config.logs.discord.channel).send(res); } catch (e) { - message.channel.send('❌ Couldn\'t send to Logging Channel.'); + message.channel.send('❌ Couldn\'t send DM or transcript log message'); } } } @@ -228,4 +227,4 @@ module.exports = { }); } -}; \ No newline at end of file +};