summaryrefslogtreecommitdiff
path: root/commands/dm.js
diff options
context:
space:
mode:
Diffstat (limited to 'commands/dm.js')
-rw-r--r--commands/dm.js68
1 files changed, 0 insertions, 68 deletions
diff --git a/commands/dm.js b/commands/dm.js
deleted file mode 100644
index ccc757c..0000000
--- a/commands/dm.js
+++ /dev/null
@@ -1,68 +0,0 @@
-const Discord = require('discord.js');
-
-module.exports = {
- name: 'dm',
- aliases: ['directmessage'],
- description: '',
- execute(msg, args, bot) {
- if (msg.author) { // TODO: fix discord not evaluating args[1]
- if (!msg.mentions.users.first() && !args[1]) {
- 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) {
- 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[1]);
-
- let emb = new Discord.RichEmbed()
-
- .addField(`message`, args[1], true)
- .addField(`recipient`, msg.mentions.users.first(), true)
- .addField(`time sent`, d)
- .setColor(0xF97DAE);
-
- msg.channel.send(RichEmbed = emb);
- });
- }
-
- // This shit took about an hour and a half to debug because I couldn't figure out how to convert the first arguement into
- // a user id. After getting help from discord.js Discord I fixed it for about 30 seconds at 21:26 and then I broke it again instantlly
- // after. Then I tried to fix everything and I almost broke everything again but I realized it was broken because I did s5n!dm instead
- // of s5n!test and I hadn't ported the code over from test to. 2020/04/02, 21:34
- //where sendTo and d went
- //args[0] = args[0].id
- //msg.reply(args[0]);
- // args[0];
-
- // msg.reply(typeof args[0]) // for debugging
-
- // const collector = new Discord.MessageCollector(msg.channel, m => m.author.id === msg.author.id, {
- // time: 5000
- // });
- // msg.reply('timed out', 5000)
- // //console.log(collector)
-
- // collector.on('collect', message => {
- // var messageText = message.content;
-
- // if (msg.member.message) {
- // msg.reply('received')
- // }
- // })
-
- // msg.reply('what would you like to say?');
- // if (msg.member.lastMessage) {
- // var messageText = msg.member.lastMessage.content;
- // }
-
- // where send function went
- } else {
- msg.reply('insufficent perms bruh');
- }
- }
-}; \ No newline at end of file