From 699c78ce75253a113f312aef08f100b43d1986f3 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Thu, 16 Jul 2020 09:46:08 +0200 Subject: [PATCH] Send a message to warn about not being able to dm the user --- commands/utility/invite.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/commands/utility/invite.js b/commands/utility/invite.js index 03df126c..fac9d424 100644 --- a/commands/utility/invite.js +++ b/commands/utility/invite.js @@ -38,8 +38,13 @@ class InviteCommand extends Command { if (args.here) { message.channel.send(invMessage); } else { - message.channel.send('Check your dm'); - return message.author.send(invMessage); + return message.author.send(invMessage) + .catch(() => { + return message.channel.send('I could not dm you! Do you have dm enabled or haven\'t blocked me?'); + }) + .then(() => { + return message.channel.send('Check your dm'); + }); } } }