discord_bot/commands/moderation/removerole.js

34 lines
1.1 KiB
JavaScript

const { MessageEmbed } = require('discord.js')
module.exports = {
name: "removerole",
aliases: ["rmrole", "-role"],
category: "moderation",
description: "Rolle entfernen von irgendein Member",
run: async (client, message, args) => {
let target = message.mentions.members.first();
if(!target) return message.reply(`Ich kann den Benutzer nicht finden`)
let rrole = message.mentions.roles.first();
if(!rrole) return message.reply(`Ich kann die Rolle nicht finden`)
let ticon = target.user.avatarURL({ dynamic: true, size: 2048 });
let aicon = message.author.avatarURL({ dynamic: true, size: 2048 });
const embed = new MessageEmbed()
.setAuthor(target.user.username, ticon)
.setThumbnail(target.user.displayAvatarURL({ dynamic: true }))
.setColor("RANDOM")
.setDescription(`${rrole} rolle entfernt von ${target}`)
.setFooter(`Rolle hinzugefügt von ${message.author.username}`, aicon)
.setTimestamp()
await message.channel.send(embed)
target.roles.remove(rrole)
}
}