I hereby decree that this document shall no longer contain the substring " == ", and hereafter shall be referred to as " === ". This amendment shall take effect immediately.
Signed-off-by: pineafan <pineapplefanyt@gmail.com>
diff --git a/src/events/guildUpdate.ts b/src/events/guildUpdate.ts
index ee02b66..e27975b 100644
--- a/src/events/guildUpdate.ts
+++ b/src/events/guildUpdate.ts
@@ -1,11 +1,14 @@
+import { callback as statsChannelUpdate } from '../reflex/statsChannelUpdate.js';
+
export const event = 'guildUpdate'
export async function callback(client, before, after) {
+ try { await statsChannelUpdate(client, after.me); } catch(e) { console.log(e)}
try {
const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta } = after.client.logger
let auditLog = await getAuditLog(after, 'GUILD_UPDATE');
- let audit = auditLog.entries.filter(entry => entry.target.id == after.id).first();
- if (audit.executor.id == client.user.id) return;
+ let audit = auditLog.entries.filter(entry => entry.target.id === after.id).first();
+ if (audit.executor.id === client.user.id) return;
let list = {}
const verificationLevels = {
@@ -27,14 +30,14 @@
ELEVATED: 'Enabled'
}
- if (before.name != after.name) list["name"] = entry([before.name, after.name], `${before.name} -> ${after.name}`);
- if (before.icon != after.icon) list["icon"] = entry([before.icon, after.icon], `[Before](${before.iconURL()}) -> [After](${after.iconURL()})`);
- if (before.splash != after.splash) list["splash"] = entry([before.splash, after.splash], `[Before](${before.splashURL()}) -> [After](${after.splashURL()})`);
- if (before.banner != after.banner) list["banner"] = entry([before.banner, after.banner], `[Before](${before.bannerURL()}) -> [After](${after.bannerURL()})`);
- if (before.owner != after.owner) list["owner"] = entry([before.owner, after.owner], `${renderUser(before.owner.user)} -> ${renderUser(after.owner.user)}`);
- if (before.verificationLevel != after.verificationLevel) list["verificationLevel"] = entry([verificationLevels[before.verificationLevel], verificationLevels[after.verificationLevel]], `${verificationLevels[before.verificationLevel]} -> ${verificationLevels[after.verificationLevel]}`);
- if (before.explicitContentFilter != after.explicitContentFilter) list["explicitContentFilter"] = entry([explicitContentFilterLevels[before.explicitContentFilter], explicitContentFilterLevels[after.explicitContentFilter]], `${explicitContentFilterLevels[before.explicitContentFilter]} -> ${explicitContentFilterLevels[after.explicitContentFilter]}`);
- if (before.mfaLevel != after.mfaLevel) list["2 factor authentication"] = entry([MFALevels[before.mfaLevel], MFALevels[after.mfaLevel]], `${MFALevels[before.mfaLevel]} -> ${MFALevels[after.mfaLevel]}`);
+ if (before.name !== after.name) list["name"] = entry([before.name, after.name], `${before.name} -> ${after.name}`);
+ if (before.icon !== after.icon) list["icon"] = entry([before.icon, after.icon], `[Before](${before.iconURL()}) -> [After](${after.iconURL()})`);
+ if (before.splash !== after.splash) list["splash"] = entry([before.splash, after.splash], `[Before](${before.splashURL()}) -> [After](${after.splashURL()})`);
+ if (before.banner !== after.banner) list["banner"] = entry([before.banner, after.banner], `[Before](${before.bannerURL()}) -> [After](${after.bannerURL()})`);
+ if (before.owner !== after.owner) list["owner"] = entry([before.owner, after.owner], `${renderUser(before.owner.user)} -> ${renderUser(after.owner.user)}`);
+ if (before.verificationLevel !== after.verificationLevel) list["verificationLevel"] = entry([verificationLevels[before.verificationLevel], verificationLevels[after.verificationLevel]], `${verificationLevels[before.verificationLevel]} -> ${verificationLevels[after.verificationLevel]}`);
+ if (before.explicitContentFilter !== after.explicitContentFilter) list["explicitContentFilter"] = entry([explicitContentFilterLevels[before.explicitContentFilter], explicitContentFilterLevels[after.explicitContentFilter]], `${explicitContentFilterLevels[before.explicitContentFilter]} -> ${explicitContentFilterLevels[after.explicitContentFilter]}`);
+ if (before.mfaLevel !== after.mfaLevel) list["2 factor authentication"] = entry([MFALevels[before.mfaLevel], MFALevels[after.mfaLevel]], `${MFALevels[before.mfaLevel]} -> ${MFALevels[after.mfaLevel]}`);
if (!(Object.keys(list).length)) return;
list["updated"] = entry(new Date().getTime(), renderDelta(new Date().getTime()))