You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Haha-Yes/commands/owner/dm.js

37 lines
1.1 KiB
JavaScript

6 years ago
const { Command } = require('discord.js-commando');
module.exports = class dmCommand extends Command {
constructor(client) {
super(client, {
name: 'dm',
group: 'owner',
memberName: 'dm',
6 years ago
aliases: ['pm'],
6 years ago
description: 'Dm the user id',
ownerOnly: true,
args: [
{
key: 'user',
6 years ago
prompt: 'Wich user would you like to dm?',
type: 'user',
6 years ago
},
{
key: 'text',
prompt: 'What do you want to say to the user',
6 years ago
type: 'string',
}
]
});
}
async run(message, { user, text }) {
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}`)
}
else {
user.send(`**Message from the dev:**\n${text}`)
message.say(`DM sent to ${user.username}`)
}
6 years ago
}
};