From fbb8d3ce40ab1bbbbe8a18a436e310a40963ebde Mon Sep 17 00:00:00 2001 From: Loic Bersier Date: Tue, 13 Nov 2018 22:32:41 +0100 Subject: [PATCH] Bot say to who the message have been sent --- commands/owner/dm.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/commands/owner/dm.js b/commands/owner/dm.js index 1625b9e..94e135d 100644 --- a/commands/owner/dm.js +++ b/commands/owner/dm.js @@ -10,30 +10,28 @@ module.exports = class dmCommand extends Command { ownerOnly: true, args: [ { - key: 'id', + key: 'user', prompt: 'Wich user would you like to dm?', - type: 'string', + type: 'user', }, { key: 'text', - prompt: 'Wich user would you like to dm?', + prompt: 'What do you want to say to the user', type: 'string', - default: '' } ] }); } - async run(message, { id, text }) { + async run(message, { user, text }) { let Attachment = (message.attachments).array(); - const user = this.client.users.get(id); if (Attachment[0]) { - user.send(`**Message from the dev**\n${text}\n${Attachment[0].url}`) - message.say('DM sent') + user.send(`**Message from the dev:**\n${text}\n${Attachment[0].url}`) + message.say(`DM sent to ${user.username}`) } else { - user.send(`**Message from the dev**\n${text}`) - message.say('DM sent') + user.send(`**Message from the dev:**\n${text}`) + message.say(`DM sent to ${user.username}`) } } }; \ No newline at end of file