From fd8f56ad1df1fe29880818db773567026f3ceca4 Mon Sep 17 00:00:00 2001 From: Loic Bersier Date: Sun, 30 Dec 2018 03:35:25 +0100 Subject: [PATCH] dm/pm users --- commands/owner/dm.js | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 commands/owner/dm.js diff --git a/commands/owner/dm.js b/commands/owner/dm.js new file mode 100644 index 0000000..7ecb93e --- /dev/null +++ b/commands/owner/dm.js @@ -0,0 +1,45 @@ +const { Command } = require('discord-akairo'); + +class EvalCommand extends Command { + constructor() { + super('dm', { + aliases: ['dm', 'pm'], + split: 'none', + category: 'owner', + args: [ + { + id: 'user', + type: 'user' + }, + { + id: 'message', + type: 'string' + } + ], + ownerOnly: 'true', + description: { + content: 'DM users', + usage: '[user id] [message]', + examples: ['267065637183029248 hello i recived your feedback and...'] + } + }); + } + + async exec(message, args) { + let user = args.user; + let message = args.message; + + let Attachment = (message.attachments).array(); + if (Attachment[0]) { + user.send(`**Message from the dev:**\n${message}\n${Attachment[0].url}`) + message.say(`DM sent to ${user.username}`) + } + else { + user.send(`**Message from the dev:**\n${message}`) + message.say(`DM sent to ${user.username}`) + } + + } +} + +module.exports = EvalCommand; \ No newline at end of file