summaryrefslogtreecommitdiff
path: root/commands/dm.js
diff options
context:
space:
mode:
Diffstat (limited to 'commands/dm.js')
-rw-r--r--commands/dm.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/commands/dm.js b/commands/dm.js
index 8c7a044..ccc757c 100644
--- a/commands/dm.js
+++ b/commands/dm.js
@@ -1,3 +1,5 @@
+const Discord = require('discord.js');
+
module.exports = {
name: 'dm',
aliases: ['directmessage'],
@@ -8,20 +10,19 @@ module.exports = {
msg.reply('you haven\'t specified a user or a message.');
} else if (!args[1]) {
msg.reply('you haven\'t specified anything to send.');
- } else if (!msg.mentions.users.first()) {
+ } else if (!msg.mentions.users) {
msg.reply('you haven\'t specified anyone to send a dm to.');
} else {
var sendTo = msg.mentions.users.first().id;
var d = new Date(msg.createdTimestamp);
msg.guild.fetchMember(sendTo, false).then(messageUser => {
- messageUser.send(args[0])
+ messageUser.send(args[1]);
let emb = new Discord.RichEmbed()
- //.setDescription(`to view the commands in each group use:\n\`s5n!commands <group>\``)
.addField(`message`, args[1], true)
- .addField(`recipient`, args[0], true)
+ .addField(`recipient`, msg.mentions.users.first(), true)
.addField(`time sent`, d)
.setColor(0xF97DAE);