Fix a bunch of linter errors
diff --git a/src/events/guildMemberUpdate.ts b/src/events/guildMemberUpdate.ts
index a7f8c47..4cffe69 100644
--- a/src/events/guildMemberUpdate.ts
+++ b/src/events/guildMemberUpdate.ts
@@ -2,14 +2,29 @@
export async function callback(client, before, after) {
try {
- const { log, NucleusColors, entry, renderUser, renderDelta, getAuditLog } = after.client.logger;
+ const {
+ log,
+ NucleusColors,
+ entry,
+ renderUser,
+ renderDelta,
+ getAuditLog
+ } = after.client.logger;
const auditLog = await getAuditLog(after.guild, "MEMBER_UPDATE");
- const audit = auditLog.entries.filter(entry => entry.target.id === after.id).first();
+ const audit = auditLog.entries
+ .filter((entry) => entry.target.id === after.id)
+ .first();
if (audit.executor.id === client.user.id) return;
if (before.nickname !== after.nickname) {
await client.database.history.create(
- "nickname", after.guild.id, after.user, audit.executor,
- null, before.nickname || before.user.username, after.nickname || after.user.username);
+ "nickname",
+ after.guild.id,
+ after.user,
+ audit.executor,
+ null,
+ before.nickname || before.user.username,
+ after.nickname || after.user.username
+ );
const data = {
meta: {
type: "memberUpdate",
@@ -22,19 +37,41 @@
list: {
memberId: entry(after.id, `\`${after.id}\``),
name: entry(after.user.id, renderUser(after.user)),
- before: entry(before.nickname, before.nickname ? before.nickname : "*None*"),
- after: entry(after.nickname, after.nickname ? after.nickname : "*None*"),
- changed: entry(new Date().getTime(), renderDelta(new Date().getTime())),
- changedBy: entry(audit.executor.id, renderUser(audit.executor))
+ before: entry(
+ before.nickname,
+ before.nickname ? before.nickname : "*None*"
+ ),
+ after: entry(
+ after.nickname,
+ after.nickname ? after.nickname : "*None*"
+ ),
+ changed: entry(
+ new Date().getTime(),
+ renderDelta(new Date().getTime())
+ ),
+ changedBy: entry(
+ audit.executor.id,
+ renderUser(audit.executor)
+ )
},
hidden: {
guild: after.guild.id
}
};
log(data);
- } else if (before.communicationDisabledUntilTimestamp < new Date().getTime() && after.communicationDisabledUntil > new Date().getTime()) {
+ } else if (
+ before.communicationDisabledUntilTimestamp < new Date().getTime() &&
+ after.communicationDisabledUntil > new Date().getTime()
+ ) {
await client.database.history.create(
- "mute", after.guild.id, after.user, audit.executor, audit.reason, null, null, null
+ "mute",
+ after.guild.id,
+ after.user,
+ audit.executor,
+ audit.reason,
+ null,
+ null,
+ null
);
const data = {
meta: {
@@ -48,25 +85,51 @@
list: {
memberId: entry(after.id, `\`${after.id}\``),
name: entry(after.user.id, renderUser(after.user)),
- mutedUntil: entry(after.communicationDisabledUntilTimestamp, renderDelta(after.communicationDisabledUntilTimestamp)),
- muted: entry(new Date().getTime(), renderDelta(new Date().getTime())),
- mutedBy: entry(audit.executor.id, renderUser(audit.executor)),
- reason: entry(audit.reason, audit.reason ? audit.reason : "\n> *No reason provided*")
+ mutedUntil: entry(
+ after.communicationDisabledUntilTimestamp,
+ renderDelta(after.communicationDisabledUntilTimestamp)
+ ),
+ muted: entry(
+ new Date().getTime(),
+ renderDelta(new Date().getTime())
+ ),
+ mutedBy: entry(
+ audit.executor.id,
+ renderUser(audit.executor)
+ ),
+ reason: entry(
+ audit.reason,
+ audit.reason ? audit.reason : "\n> *No reason provided*"
+ )
},
hidden: {
guild: after.guild.id
}
};
log(data);
- client.database.eventScheduler.schedule("naturalUnmute", after.communicationDisabledUntil,
- {guild: after.guild.id, user: after.id, expires: after.communicationDisabledUntilTimestamp}
+ client.database.eventScheduler.schedule(
+ "naturalUnmute",
+ after.communicationDisabledUntil,
+ {
+ guild: after.guild.id,
+ user: after.id,
+ expires: after.communicationDisabledUntilTimestamp
+ }
);
} else if (
- after.communicationDisabledUntil === null && before.communicationDisabledUntilTimestamp !== null &&
+ after.communicationDisabledUntil === null &&
+ before.communicationDisabledUntilTimestamp !== null &&
new Date().getTime() >= audit.createdTimestamp
) {
await client.database.history.create(
- "unmute", after.guild.id, after.user, audit.executor, null, null, null, null
+ "unmute",
+ after.guild.id,
+ after.user,
+ audit.executor,
+ null,
+ null,
+ null,
+ null
);
const data = {
meta: {
@@ -80,15 +143,27 @@
list: {
memberId: entry(after.id, `\`${after.id}\``),
name: entry(after.user.id, renderUser(after.user)),
- unmuted: entry(new Date().getTime(), renderDelta(new Date().getTime())),
- unmutedBy: entry(audit.executor.id, renderUser(audit.executor))
+ unmuted: entry(
+ new Date().getTime(),
+ renderDelta(new Date().getTime())
+ ),
+ unmutedBy: entry(
+ audit.executor.id,
+ renderUser(audit.executor)
+ )
},
hidden: {
guild: after.guild.id
}
};
log(data);
- client.database.eventScheduler.cancel("naturalUnmute", {guild: after.guild.id, user: after.id, expires: before.communicationDisabledUntilTimestamp});
+ client.database.eventScheduler.cancel("naturalUnmute", {
+ guild: after.guild.id,
+ user: after.id,
+ expires: before.communicationDisabledUntilTimestamp
+ });
}
- } catch (e) { console.log(e); }
+ } catch (e) {
+ console.log(e);
+ }
}