few changes
diff --git a/src/events/roleDelete.ts b/src/events/roleDelete.ts
index c5cbe63..6edfeed 100644
--- a/src/events/roleDelete.ts
+++ b/src/events/roleDelete.ts
@@ -3,34 +3,36 @@
export const event = 'roleDelete'
export async function callback(client, role) {
- const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta } = role.client.logger
- if (role.managed) return;
- let auditLog = await getAuditLog(role.guild, 'ROLE_DELETE');
- let audit = auditLog.entries.filter(entry => entry.target.id == role.id).first();
- if (audit.executor.id == client.user.id) return;
- let data = {
- meta: {
- type: 'roleDelete',
- displayName: 'Role Deleted',
- calculateType: 'guildRoleUpdate',
- color: NucleusColors.red,
- emoji: "GUILD.ROLES.DELETE",
- timestamp: audit.createdTimestamp,
- },
- list: {
- id: entry(role.id, `\`${role.id}\``),
- role: entry(role.name, role.name),
- color: entry(role.hexColor, `\`${role.hexColor}\``),
- showInMemberList: entry(role.hoist, role.hoist ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`),
- mentionable: entry(role.mentionable, role.mentionable ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`),
- members: entry(role.members.size, `${role.members.size}`),
- deletedBy: entry(audit.executor.id, renderUser(audit.executor)),
- created: entry(role.createdTimestamp, renderDelta(role.createdTimestamp)),
- deleted: entry(new Date().getTime(), renderDelta(new Date().getTime()))
- },
- hidden: {
- guild: role.guild.id
+ try {
+ const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta } = role.client.logger
+ if (role.managed) return;
+ let auditLog = await getAuditLog(role.guild, 'ROLE_DELETE');
+ let audit = auditLog.entries.filter(entry => entry.target.id == role.id).first();
+ if (audit.executor.id == client.user.id) return;
+ let data = {
+ meta: {
+ type: 'roleDelete',
+ displayName: 'Role Deleted',
+ calculateType: 'guildRoleUpdate',
+ color: NucleusColors.red,
+ emoji: "GUILD.ROLES.DELETE",
+ timestamp: audit.createdTimestamp,
+ },
+ list: {
+ id: entry(role.id, `\`${role.id}\``),
+ role: entry(role.name, role.name),
+ color: entry(role.hexColor, `\`${role.hexColor}\``),
+ showInMemberList: entry(role.hoist, role.hoist ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`),
+ mentionable: entry(role.mentionable, role.mentionable ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`),
+ members: entry(role.members.size, `${role.members.size}`),
+ deletedBy: entry(audit.executor.id, renderUser(audit.executor)),
+ created: entry(role.createdTimestamp, renderDelta(role.createdTimestamp)),
+ deleted: entry(new Date().getTime(), renderDelta(new Date().getTime()))
+ },
+ hidden: {
+ guild: role.guild.id
+ }
}
- }
- log(data, client);
+ log(data, client);
+ } catch {}
}