Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

Commit

Permalink
Mod mail
Browse files Browse the repository at this point in the history
  • Loading branch information
lainq committed May 9, 2021
1 parent 80ad099 commit 5817e17
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions commands/mod/mail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// @ts-check

const { MessageEmbed } = require("discord.js")
const { getRandomColor } = require('../../utils/embeds.js')

module.exports.run = function(args, message, client) {
const data = args.join(' ')
const members = message.guild.members.cache.filter((member) => {
return member.hasPermission("ADMINISTRATOR") && !member.user.bot
})
const embed = new MessageEmbed()
embed.setColor(getRandomColor())
embed.setDescription(data)
embed.setAuthor(message.author.username, message.author.avatarURL())
members.forEach((admin) => {
admin.send(embed).then((messageData) => {
messageData.react("😐")
})
})

message.delete().then(() => {}).catch(() => {})
}

0 comments on commit 5817e17

Please sign in to comment.