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

45 lines
927 B
JavaScript

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: 'text',
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 text = args.text;
let Attachment = (message.attachments).array();
if (Attachment[0]) {
user.send(`**Message from the dev:**\n${text}\n${Attachment[0].url}`);
message.channel.send(`DM sent to ${user.username}`);
}
else {
user.send(`**Message from the dev:**\n${text}`);
message.channel.send(`DM sent to ${user.username}`);
}
}
}
module.exports = EvalCommand;