1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
// TODO: remove mention from final msg
import { Command, CommandoMessage } from 'discord.js-commando';
import { MessageEmbed } from 'discord.js';
module.exports = class DMFun extends Command {
constructor(client) {
super(client, {
name: 'dm',
aliases: [
'directmessage',
'directmsg',
'direct-message',
'direct-msg'
],
group: 'fun',
memberName: 'dm',
description: 'Allows you to DM somebody as the bot.',
guildOnly: true,
args: [
{
key: 'msgContent',
prompt: 'What message would you like to send?',
type: 'string'
}
],
examples: [
'uwu!dm @sin#1337 hi',
'uwu!directmessage @sin#1337 hey',
'uwu!directmsg @sin#1337 hello',
'uwu!direct-message @sin#1337 yo',
'uwu!direct-msg @sin#1337 aye',
],
userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'ADMINISTRATOR'],
clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
});
}
run(msg: CommandoMessage, { msgContent }) {
if (msg.author.id == '217348698294714370') {
if (!msg.mentions.users.first() && msgContent) {
msg.reply('You haven\'t specified anyone to send a message to.');
} else {
var sendTo = msg.mentions.users.first().id;
var d = new Date(msg.createdTimestamp);
msg.guild.members.fetch(sendTo).then(messageUser => {
messageUser.send(msgContent);
var emb = new MessageEmbed()
.setColor(0xFFCC4D)
.setTitle('uwufier - DM')
.addField('Message content', `${msgContent}`)
.addField('Recipient', `${msg.mentions.users.first()}`)
.addField('Sender', `${msg.author}`)
.addField('Time sent', `Now`)
msg.say(emb)
});
}
} else {
msg.reply('Insufficent permissions.');
}
}
};
|