Haha-Yes/commands/owner/dm.js

37 lines
1.1 KiB
JavaScript
Raw Normal View History

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: [
{
key: 'user',
2018-10-02 19:48:25 +02:00
prompt: 'Wich user would you like to dm?',
type: 'user',
2018-10-02 19:48:25 +02:00
},
{
key: 'text',
prompt: 'What do you want to say to the user',
2018-10-02 19:48:25 +02:00
type: 'string',
}
]
});
}
async run(message, { user, text }) {
2018-11-05 00:12:32 +01:00
let Attachment = (message.attachments).array();
if (Attachment[0]) {
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 {
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
}
};