diff --git a/commands/owner/dm.js b/commands/owner/dm.js index 2f785ff..2e3f752 100644 --- a/commands/owner/dm.js +++ b/commands/owner/dm.js @@ -31,12 +31,22 @@ class EvalCommand extends Command { let Attachment = (message.attachments).array(); if (Attachment[0]) { - this.client.users.get(user).send(`**Message from the dev:**\n${text}\n${Attachment[0].url}\n**If you wish to respond use the feedback command**`); - message.channel.send(`DM sent to ${user.username}`); + this.client.users.get(user.id).send(`**Message from the dev:**\n${text}\n**If you wish to respond use the feedback command**`, {files: [Attachment[0].url]}) + .then(() => { + return message.channel.send(`DM sent to ${user.username}`); + }) + .catch(() => { + return message.channel.send(`Could not send a DM to ${user.username}`); + }); } else { - this.client.users.get(user.id).send(`**Message from the dev:**\n${text}\n**If you wish to respond use the feedback command**`); - message.channel.send(`DM sent to ${user.username}`); + this.client.users.get(user.id).send(`**Message from the dev:**\n${text}\n**If you wish to respond use the feedback command**`) + .then(() => { + return message.channel.send(`DM sent to ${user.username}`); + }) + .catch(() => { + return message.channel.send(`Could not send a DM to ${user.username}`); + }); } }