nyx/commands/Config/migrate.js
night0721 bc346138dd Bot
2021-06-12 18:53:51 +08:00

26 lines
750 B
JavaScript

const { Client, Message, MessageEmbed } = require("discord.js");
module.exports = {
name: "migrate",
usage: "(Server ID)",
description: "Migrate all emojis from a server",
category: "Config",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
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);
}
},
};