From 390bec85c87f4fc47835daabb61f4b3fed316c18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Guzman?= <36934590+mgsi100@users.noreply.github.com> Date: Thu, 3 Dec 2020 22:40:33 +0100 Subject: [PATCH] Made it so the bot dm's the creator and logs it in an logging channel --- src/commands/close.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/commands/close.js b/src/commands/close.js index ee5df32..390cc21 100644 --- a/src/commands/close.js +++ b/src/commands/close.js @@ -126,6 +126,12 @@ module.exports = { let u = await client.users.fetch(ticket.creator); if (u) { + let dm; + try { + dm = u.dmChannel || await u.createDM(); + } catch (e) { + log.warn(`Could not create DM channel with ${u.tag}`); + } const archive = client.channels.cache.find(ch => ch.id === "") let res = {}; @@ -158,6 +164,7 @@ module.exports = { try { archive.send(res) + dm.send(res) } catch (e) { message.channel.send('❌ Couldn\'t send to Logging Channel.'); }