30 lines
1.1 KiB
JavaScript
30 lines
1.1 KiB
JavaScript
|
const Discord = require('discord.js')
|
||
|
const { parse } = require("twemoji-parser");
|
||
|
const { MessageEmbed } = require("discord.js");
|
||
|
module.exports = {
|
||
|
name: "add-these",
|
||
|
category: "moderation",
|
||
|
run: async (client, message, args) => {
|
||
|
if (!message.member.hasPermission("MANAGE_EMOJIS")) {
|
||
|
return message.channel.send(`:x: | **You Don't Have Permission To Use This Command**`)
|
||
|
}
|
||
|
const emojis = args.join(" ").match(/<?(a)?:?(\w{2,32}):(\d{17,19})>?/gi)
|
||
|
if (!emojis) return message.channel.send(`:x: | **Geben Sie die hinzuzufügenden Emojis an**`);
|
||
|
emojis.forEach(emote => {
|
||
|
let emoji = Discord.Util.parseEmoji(emote);
|
||
|
if (emoji.id) {
|
||
|
const Link = `https://cdn.discordapp.com/emojis/${emoji.id}.${
|
||
|
emoji.animated ? "gif" : "png"
|
||
|
}`
|
||
|
message.guild.emojis.create(
|
||
|
`${Link}`,
|
||
|
`${`${emoji.name}`}`
|
||
|
).then(em => message.channel.send(em.toString() + " added!")).catch(error => {
|
||
|
message.channel.send(":x: | es ist ein Fehler aufgetreten")
|
||
|
console.log(error)
|
||
|
})
|
||
|
|
||
|
}
|
||
|
})
|
||
|
}
|
||
|
}
|