import getEmojiByName from "../utils/getEmojiByName.js";

export const event = 'emojiUpdate';

export async function callback(client, oe, ne) {
	const { getAuditLog, log, NucleusColors, entry, renderDelta, renderUser, renderEmoji } = client.logger

    if (oe.name == ne.name) return
	let auditLog = await getAuditLog(ne.guild, 'EMOJI_UPDATE');
	let audit = auditLog.entries.first();
    if (audit.executor.id == client.user.id) return;

	let changes = {
		id: entry(ne.id, `\`${ne.id}\``),
		emoji: entry(ne.id, renderEmoji(ne)),
		edited: entry(ne.createdTimestamp, renderDelta(ne.createdTimestamp)),
		editedBy: entry(audit.executor.id, renderUser((await ne.guild.members.fetch(audit.executor.id)).user)),
		name: entry([oe.name, ne.name], `\`:${oe.name}:\` -> \`:${ne.name}:\``),
	}
	let data = {
		meta:{
			type: 'emojiUpdate',
			displayName: 'Emoji Edited',
			calculateType: 'emojiUpdate',
			color: NucleusColors.yellow,
			emoji: "GUILD.EMOJI.EDIT",
			timestamp: audit.createdTimestamp
		},
		list: changes,
		hidden: {
			guild: ne.guild.id
		}
	}
	log(data, client);
}