diff options
| author | 8cy <[email protected]> | 2020-04-16 04:56:37 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-16 04:56:37 -0700 |
| commit | 8c435855e647ee7aef8578e253caf91fe44c67cc (patch) | |
| tree | ae0bb59de10ecec5ca2fc01dfa9190efd1f177ab /src/commands/fun/dm.ts | |
| parent | no longer hosting ws, v6.0.4 (diff) | |
| download | dep-core-8c435855e647ee7aef8578e253caf91fe44c67cc.tar.xz dep-core-8c435855e647ee7aef8578e253caf91fe44c67cc.zip | |
The Purification, v7.0.0
add:
- aesthetic, oddcase, stretch, surreal
- culturedtext
- dogeify
- howify
- insult
- lorem
- spongebob
Other Stuff:
- many refactoring
Diffstat (limited to 'src/commands/fun/dm.ts')
| -rw-r--r-- | src/commands/fun/dm.ts | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/commands/fun/dm.ts b/src/commands/fun/dm.ts new file mode 100644 index 0000000..73fa0b6 --- /dev/null +++ b/src/commands/fun/dm.ts @@ -0,0 +1,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.'); + } + } +};
\ No newline at end of file |