Fix a bunch of linter errors
diff --git a/src/events/roleUpdate.ts b/src/events/roleUpdate.ts
index c51a9b3..be276e5 100644
--- a/src/events/roleUpdate.ts
+++ b/src/events/roleUpdate.ts
@@ -3,7 +3,15 @@
export const event = "roleUpdate";
export async function callback(client, or, nr) {
- const { getAuditLog, log, NucleusColors, entry, renderDelta, renderUser, renderRole } = client.logger;
+ const {
+ getAuditLog,
+ log,
+ NucleusColors,
+ entry,
+ renderDelta,
+ renderUser,
+ renderRole
+ } = client.logger;
const auditLog = await getAuditLog(nr.guild, "ROLE_UPDATE");
const audit = auditLog.entries.first();
@@ -13,24 +21,52 @@
roleId: entry(nr.id, `\`${nr.id}\``),
role: entry(nr.id, renderRole(nr)),
edited: entry(new Date().getTime(), renderDelta(new Date().getTime())),
- editedBy: entry(audit.executor.id, renderUser((await nr.guild.members.fetch(audit.executor.id)).user))
+ editedBy: entry(
+ audit.executor.id,
+ renderUser((await nr.guild.members.fetch(audit.executor.id)).user)
+ )
};
const mentionable = ["", ""];
const hoist = ["", ""];
- mentionable[0] = or.mentionable ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`;
- mentionable[1] = nr.mentionable ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`;
- hoist[0] = or.hoist ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`;
- hoist[1] = nr.hoist ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`;
- if (or.name !== nr.name) changes["name"] = entry([or.name, nr.name], `${or.name} -> ${nr.name}`);
- if (or.position !== nr.position) changes["position"] = entry([or.position, nr.position], `${or.position} -> ${nr.position}`);
- if (or.hoist !== nr.hoist) changes["showInMemberList"] = entry([or.hoist, nr.hoist], `${hoist[0]} -> ${hoist[1]}`);
- if (or.mentionable !== nr.mentionable) changes["mentionable"] = entry([or.mentionable, nr.mentionable], `${mentionable[0]} -> ${mentionable[1]}`);
- if (or.hexColor !== nr.hexColor) changes["color"] = entry([or.hexColor, nr.hexColor], `\`${or.hexColor}\` -> \`${nr.hexColor}\``);
+ mentionable[0] = or.mentionable
+ ? `${getEmojiByName("CONTROL.TICK")} Yes`
+ : `${getEmojiByName("CONTROL.CROSS")} No`;
+ mentionable[1] = nr.mentionable
+ ? `${getEmojiByName("CONTROL.TICK")} Yes`
+ : `${getEmojiByName("CONTROL.CROSS")} No`;
+ hoist[0] = or.hoist
+ ? `${getEmojiByName("CONTROL.TICK")} Yes`
+ : `${getEmojiByName("CONTROL.CROSS")} No`;
+ hoist[1] = nr.hoist
+ ? `${getEmojiByName("CONTROL.TICK")} Yes`
+ : `${getEmojiByName("CONTROL.CROSS")} No`;
+ if (or.name !== nr.name)
+ changes.name = entry([or.name, nr.name], `${or.name} -> ${nr.name}`);
+ if (or.position !== nr.position)
+ changes.position = entry(
+ [or.position, nr.position],
+ `${or.position} -> ${nr.position}`
+ );
+ if (or.hoist !== nr.hoist)
+ changes.showInMemberList = entry(
+ [or.hoist, nr.hoist],
+ `${hoist[0]} -> ${hoist[1]}`
+ );
+ if (or.mentionable !== nr.mentionable)
+ changes.mentionable = entry(
+ [or.mentionable, nr.mentionable],
+ `${mentionable[0]} -> ${mentionable[1]}`
+ );
+ if (or.hexColor !== nr.hexColor)
+ changes.color = entry(
+ [or.hexColor, nr.hexColor],
+ `\`${or.hexColor}\` -> \`${nr.hexColor}\``
+ );
if (Object.keys(changes).length === 4) return;
const data = {
- meta:{
+ meta: {
type: "roleUpdate",
displayName: "Role Edited",
calculateType: "guildRoleUpdate",
@@ -44,4 +80,4 @@
}
}; // TODO: show perms changed (webpage)
log(data);
-}
\ No newline at end of file
+}