diff options
| author | 8cy <[email protected]> | 2020-04-13 05:32:35 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-13 05:32:35 -0700 |
| commit | 9dff52f7d047c905326bc2f476ede5463e00f2a0 (patch) | |
| tree | 1fec8563b3b72fde9b2ab7ad9e56a97398798685 /src/commands/fun/dm.js | |
| parent | typescript (diff) | |
| download | s5nical-9dff52f7d047c905326bc2f476ede5463e00f2a0.tar.xz s5nical-9dff52f7d047c905326bc2f476ede5463e00f2a0.zip | |
typescript final
Diffstat (limited to 'src/commands/fun/dm.js')
| -rw-r--r-- | src/commands/fun/dm.js | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/commands/fun/dm.js b/src/commands/fun/dm.js new file mode 100644 index 0000000..fc10f28 --- /dev/null +++ b/src/commands/fun/dm.js @@ -0,0 +1,51 @@ +const { Command } = require('discord.js-commando'); +const { RichEmbed } = require('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: 'dm someone', + guildOnly: true, + args: [ + { + key: 'msgContent', + prompt: 'what would u like to send', + type: 'string' + } + ], + examples: [ + 's5n!dm @sin#1337 hi', + 's5n!directmessage @sin#1337 hey', + 's5n!directmsg @sin#1337 hello', + 's5n!direct-message @sin#1337 yo', + 's5n!direct-msg @sin#1337 aye', + ] + }); + } + run(msg, { msgContent }) { + if (msg.author) { + if (!msg.mentions.users.first() && msgContent) { + msg.reply('you haven\'t specified anyone to send to.'); + } else { + var sendTo = msg.mentions.users.first().id; + var d = new Date(msg.createdTimestamp); + + msg.guild.members.fetch(sendTo, false).then(messageUser => { + messageUser.send(msgContent); + msg.reply('sent :D'); + }); + } + } else { + msg.reply('insufficent perms bruh'); + } + } +};
\ No newline at end of file |