2022-07-29 23:31:08 +05:00
|
|
|
const Command = require("../../base/Command"),
|
2022-07-31 17:08:00 +05:00
|
|
|
{ parseEmoji } = require("discord.js");
|
2022-07-29 23:31:08 +05:00
|
|
|
|
|
|
|
class Stealemoji extends Command {
|
|
|
|
constructor(client) {
|
|
|
|
super(client, {
|
|
|
|
name: "stealemoji",
|
|
|
|
dirname: __dirname,
|
|
|
|
enabled: true,
|
|
|
|
guildOnly: true,
|
|
|
|
aliases: ["steale"],
|
|
|
|
memberPermissions: ["MANAGE_GUILD"],
|
|
|
|
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
|
|
|
nsfw: false,
|
|
|
|
ownerOnly: false,
|
|
|
|
cooldown: 1000
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
async run(message, args) {
|
|
|
|
if (!args.length) return message.error("administration/stealemoji:MISSING_EMOJI");
|
|
|
|
|
|
|
|
for (const rawEmoji of args) {
|
2022-07-31 17:08:00 +05:00
|
|
|
const parsedEmoji = parseEmoji(rawEmoji);
|
2022-07-29 23:31:08 +05:00
|
|
|
const extension = parsedEmoji.animated ? "gif" : "png";
|
|
|
|
|
|
|
|
message.guild.emojis
|
|
|
|
.create(`https://cdn.discordapp.com/emojis/${parsedEmoji.id}.${extension}`, parsedEmoji.name)
|
|
|
|
.then(emoji => message.success("administration/stealemoji:SUCCESS", {
|
|
|
|
emoji: emoji.name
|
|
|
|
}))
|
|
|
|
.catch(() => message.error("administration/stealemoji:ERROR", {
|
|
|
|
emoji: parsedEmoji.name
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Stealemoji;
|