Reformat using prettier
diff --git a/src/events/roleUpdate.ts b/src/events/roleUpdate.ts
index 8d9ef10..236bc0f 100644
--- a/src/events/roleUpdate.ts
+++ b/src/events/roleUpdate.ts
@@ -6,9 +6,10 @@
export async function callback(client: NucleusClient, oldRole: Role, newRole: Role) {
const { getAuditLog, isLogging, log, NucleusColors, entry, renderDelta, renderUser, renderRole } = client.logger;
- if (!await isLogging(newRole.guild.id, "guildRoleUpdate")) return;
- const auditLog = (await getAuditLog(newRole.guild as Guild, AuditLogEvent.RoleUpdate))
- .filter((entry: GuildAuditLogsEntry) => (entry.target as Role)!.id === newRole.id)[0];
+ if (!(await isLogging(newRole.guild.id, "guildRoleUpdate"))) return;
+ const auditLog = (await getAuditLog(newRole.guild as Guild, AuditLogEvent.RoleUpdate)).filter(
+ (entry: GuildAuditLogsEntry) => (entry.target as Role)!.id === newRole.id
+ )[0];
if (!auditLog) return;
if (auditLog.executor!.id === client.user!.id) return;
@@ -16,22 +17,40 @@
roleId: entry(newRole.id, `\`${newRole.id}\``),
role: entry(newRole.id, renderRole(newRole)),
edited: entry(Date.now(), renderDelta(Date.now())),
- editedBy: entry(auditLog.executor!.id, renderUser((await newRole.guild.members.fetch(auditLog.executor!.id)).user))
+ editedBy: entry(
+ auditLog.executor!.id,
+ renderUser((await newRole.guild.members.fetch(auditLog.executor!.id)).user)
+ )
};
const mentionable = ["", ""];
const hoist = ["", ""];
- mentionable[0] = oldRole.mentionable ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`;
- mentionable[1] = newRole.mentionable ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`;
+ mentionable[0] = oldRole.mentionable
+ ? `${getEmojiByName("CONTROL.TICK")} Yes`
+ : `${getEmojiByName("CONTROL.CROSS")} No`;
+ mentionable[1] = newRole.mentionable
+ ? `${getEmojiByName("CONTROL.TICK")} Yes`
+ : `${getEmojiByName("CONTROL.CROSS")} No`;
hoist[0] = oldRole.hoist ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`;
hoist[1] = newRole.hoist ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`;
- if (oldRole.name !== newRole.name) changes["name"] = entry([oldRole.name, newRole.name], `${oldRole.name} -> ${newRole.name}`);
+ if (oldRole.name !== newRole.name)
+ changes["name"] = entry([oldRole.name, newRole.name], `${oldRole.name} -> ${newRole.name}`);
if (oldRole.position !== newRole.position)
- changes["position"] = entry([oldRole.position.toString(), newRole.position.toString()], `${oldRole.position} -> ${newRole.position}`);
- if (oldRole.hoist !== newRole.hoist) changes["showInMemberList"] = entry([oldRole.hoist, newRole.hoist], `${hoist[0]} -> ${hoist[1]}`);
+ changes["position"] = entry(
+ [oldRole.position.toString(), newRole.position.toString()],
+ `${oldRole.position} -> ${newRole.position}`
+ );
+ if (oldRole.hoist !== newRole.hoist)
+ changes["showInMemberList"] = entry([oldRole.hoist, newRole.hoist], `${hoist[0]} -> ${hoist[1]}`);
if (oldRole.mentionable !== newRole.mentionable)
- changes["mentionable"] = entry([oldRole.mentionable, newRole.mentionable], `${mentionable[0]} -> ${mentionable[1]}`);
+ changes["mentionable"] = entry(
+ [oldRole.mentionable, newRole.mentionable],
+ `${mentionable[0]} -> ${mentionable[1]}`
+ );
if (oldRole.hexColor !== newRole.hexColor)
- changes["color"] = entry([oldRole.hexColor, newRole.hexColor], `\`${oldRole.hexColor}\` -> \`${newRole.hexColor}\``);
+ changes["color"] = entry(
+ [oldRole.hexColor, newRole.hexColor],
+ `\`${oldRole.hexColor}\` -> \`${newRole.hexColor}\``
+ );
if (oldRole.permissions.bitfield !== newRole.permissions.bitfield) {
changes["permissions"] = entry(
[oldRole.permissions.bitfield.toString(), newRole.permissions.bitfield.toString()],