From 41b5c7ea4201bb245ffc4d74139324116a97ec01 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Tue, 2 Oct 2018 19:48:25 +0200 Subject: [PATCH] can dm user --- commands/owner/dm.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 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 00000000..faa04139 --- /dev/null +++ b/commands/owner/dm.js @@ -0,0 +1,30 @@ +const { Command } = require('discord.js-commando'); +module.exports = class dmCommand extends Command { + constructor(client) { + super(client, { + name: 'dm', + group: 'owner', + memberName: 'dm', + description: 'Dm the user id', + ownerOnly: true, + args: [ + { + key: 'id', + prompt: 'Wich user would you like to dm?', + type: 'string', + }, + { + key: 'text', + prompt: 'Wich user would you like to dm?', + type: 'string', + } + ] + }); + } + + async run(message, { id, text }) { + const user = this.client.users.get(id); + user.send(`**Message from the dev**\n${text}`) + message.send('DM sent') + } +}; \ No newline at end of file