2021-06-12 12:53:51 +02:00
|
|
|
const { Client, Message, MessageEmbed } = require("discord.js");
|
|
|
|
module.exports = {
|
2021-11-18 18:56:42 +01:00
|
|
|
name: "migrate",
|
|
|
|
usage: "(Server ID)",
|
|
|
|
description: "Migrate all emojis from a server",
|
|
|
|
category: "Config",
|
|
|
|
run: async (client, message, args) => {
|
|
|
|
try {
|
|
|
|
const oldGuild = args[0];
|
|
|
|
if (!oldGuild) return;
|
|
|
|
old = client.guilds.cache.get(oldGuild);
|
|
|
|
if (!old) return client.err(message, "Config", "migrate", 404);
|
|
|
|
await old.emojis.cache.map(async e => {
|
|
|
|
await message.guild.emojis.create(e.url, e.name);
|
|
|
|
});
|
|
|
|
return message.channel.send(`Created Emotes.`);
|
|
|
|
}
|
|
|
|
catch (e) {
|
|
|
|
console.log(e);
|
|
|
|
}
|
|
|
|
},
|
2021-06-12 12:53:51 +02:00
|
|
|
};
|