diff options
| author | 8cy <[email protected]> | 2020-04-07 12:21:51 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-07 12:21:51 -0700 |
| commit | eeec49be9a0d60a855a4aa8ef5f1c46178b461e0 (patch) | |
| tree | 72f10eb527881f2d208b859dd381442629626654 | |
| parent | add uptime command, v1.3.2 (diff) | |
| download | s5nical-eeec49be9a0d60a855a4aa8ef5f1c46178b461e0.tar.xz s5nical-eeec49be9a0d60a855a4aa8ef5f1c46178b461e0.zip | |
edit some dm handling stuff, v1.3.3
| -rw-r--r-- | commands/dm.js | 9 |
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); |