mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-25 14:44:58 +05:00
185103044c
stealemoji Мелкие правки
39 lines
No EOL
1 KiB
JavaScript
39 lines
No EOL
1 KiB
JavaScript
const Command = require("../../base/Command"),
|
|
{ Util } = require("discord.js");
|
|
|
|
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) {
|
|
const parsedEmoji = Util.parseEmoji(rawEmoji);
|
|
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; |