blob: 669de324eb690314174b0653a3c9a68474d3e943 [file] [log] [blame]
pineafanda6e5342022-07-03 10:03:16 +01001export const event = 'stickerCreate'
2
3export async function callback(client, emoji) {
4 try {
5 const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta } = emoji.client.logger
6 let auditLog = await getAuditLog(emoji.guild, 'STICKER_CREATE');
pineafane23c4ec2022-07-27 21:56:27 +01007 let audit = auditLog.entries.filter(entry => entry.target.id === emoji.id).first();
8 if (audit.executor.id === client.user.id) return;
pineafanda6e5342022-07-03 10:03:16 +01009 let data = {
10 meta: {
11 type: 'stickerCreate',
12 displayName: 'Sticker Created',
13 calculateType: 'stickerUpdate',
14 color: NucleusColors.green,
15 emoji: "GUILD.EMOJI.CREATE",
16 timestamp: emoji.createdTimestamp
17 },
18 list: {
19 stickerId: entry(emoji.id, `\`${emoji.id}\``),
20 emoji: entry(emoji.name, `\`:${emoji.name}:\``),
21 createdBy: entry(audit.executor.id, renderUser(audit.executor)),
22 created: entry(emoji.createdTimestamp, renderDelta(emoji.createdTimestamp))
23 },
24 hidden: {
25 guild: emoji.guild.id
26 }
27 }
28 log(data);
29 } catch {}
30}