From ee2dc62a74a311a4daf2b92e0f30eea075115ccf Mon Sep 17 00:00:00 2001 From: Jonathan Barrow Date: Sun, 28 Aug 2022 10:44:08 -0400 Subject: [PATCH] Added catch to user DMs --- src/commands/ban.js | 2 +- src/commands/kick.js | 2 +- src/commands/warn.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/ban.js b/src/commands/ban.js index b25dcb2..5e8291b 100644 --- a/src/commands/ban.js +++ b/src/commands/ban.js @@ -134,7 +134,7 @@ async function banHandler(interaction) { await member.send({ embeds: sendMemberEmbeds - }); + }).catch(() => console.log('Failed to DM user')); await member.ban({ reason diff --git a/src/commands/kick.js b/src/commands/kick.js index b1b700d..2d3f082 100644 --- a/src/commands/kick.js +++ b/src/commands/kick.js @@ -175,7 +175,7 @@ async function kickHandler(interaction) { await member.send({ embeds: sendMemberEmbeds - }); + }).catch(() => console.log('Failed to DM user')); if (isKick) { await member.kick(reason); diff --git a/src/commands/warn.js b/src/commands/warn.js index 8c292dc..dc9b031 100644 --- a/src/commands/warn.js +++ b/src/commands/warn.js @@ -179,7 +179,7 @@ async function warnHandler(interaction) { await member.send({ embeds: [punishmentEmbed, pastWarningsEmbed] - }); + }).catch(() => console.log('Failed to DM user')); if (isKick) { await member.kick(reason); @@ -240,7 +240,7 @@ async function warnHandler(interaction) { await member.send({ embeds: [punishmentEmbed] - }); + }).catch(() => console.log('Failed to DM user')); } await Warnings.create({