2018-10-02 19:48:25 +02:00
|
|
|
const { Command } = require('discord.js-commando');
|
|
|
|
module.exports = class dmCommand extends Command {
|
|
|
|
constructor(client) {
|
|
|
|
super(client, {
|
|
|
|
name: 'dm',
|
|
|
|
group: 'owner',
|
|
|
|
memberName: 'dm',
|
2018-11-08 20:48:05 +01:00
|
|
|
aliases: ['pm'],
|
2018-10-02 19:48:25 +02:00
|
|
|
description: 'Dm the user id',
|
|
|
|
ownerOnly: true,
|
|
|
|
args: [
|
|
|
|
{
|
2018-11-13 22:32:41 +01:00
|
|
|
key: 'user',
|
2018-10-02 19:48:25 +02:00
|
|
|
prompt: 'Wich user would you like to dm?',
|
2018-11-13 22:32:41 +01:00
|
|
|
type: 'user',
|
2018-10-02 19:48:25 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
key: 'text',
|
2018-11-13 22:32:41 +01:00
|
|
|
prompt: 'What do you want to say to the user',
|
2018-10-02 19:48:25 +02:00
|
|
|
type: 'string',
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-11-13 22:32:41 +01:00
|
|
|
async run(message, { user, text }) {
|
2018-11-05 00:12:32 +01:00
|
|
|
let Attachment = (message.attachments).array();
|
|
|
|
if (Attachment[0]) {
|
2018-11-13 22:32:41 +01:00
|
|
|
user.send(`**Message from the dev:**\n${text}\n${Attachment[0].url}`)
|
|
|
|
message.say(`DM sent to ${user.username}`)
|
2018-11-05 00:12:32 +01:00
|
|
|
}
|
|
|
|
else {
|
2018-11-13 22:32:41 +01:00
|
|
|
user.send(`**Message from the dev:**\n${text}`)
|
|
|
|
message.say(`DM sent to ${user.username}`)
|
2018-11-05 00:12:32 +01:00
|
|
|
}
|
2018-10-02 19:48:25 +02:00
|
|
|
}
|
|
|
|
};
|