Still got errors and warnings, mostly the same and easy to fix
diff --git a/src/events/guildBanAdd.ts b/src/events/guildBanAdd.ts
index 06163a9..c5d269b 100644
--- a/src/events/guildBanAdd.ts
+++ b/src/events/guildBanAdd.ts
@@ -1,39 +1,37 @@
-import { purgeByUser } from '../actions/tickets/delete.js';
-import { callback as statsChannelRemove } from '../reflex/statsChannelUpdate.js';
+import { purgeByUser } from "../actions/tickets/delete.js";
+import { callback as statsChannelRemove } from "../reflex/statsChannelUpdate.js";
-export const event = 'guildBanAdd';
+export const event = "guildBanAdd";
export async function callback(client, ban) {
- try { await statsChannelRemove(client, ban.user); } catch {}
- try { purgeByUser(ban.user.id, ban.guild); } catch {}
- try {
- const { log, NucleusColors, entry, renderUser, renderDelta, getAuditLog } = ban.user.client.logger
- let auditLog = await getAuditLog(ban.guild, 'MEMBER_BAN_ADD')
- let audit = auditLog.entries.filter(entry => entry.target.id === ban.user.id).first();
- if (audit.executor.id === client.user.id) return
- try { await client.database.history.create("ban", ban.guild.id, ban.user, audit.executor, audit.reason) } catch {}
- let data = {
- meta: {
- type: 'memberBan',
- displayName: 'Member Banned',
- calculateType: 'guildMemberPunish',
- color: NucleusColors.red,
- emoji: "PUNISH.BAN.RED",
- timestamp: new Date().getTime()
- },
- list: {
- memberId: entry(ban.user.id, `\`${ban.user.id}\``),
- name: entry(ban.user.id, renderUser(ban.user)),
- banned: entry(new Date().getTime(), renderDelta(new Date().getTime())),
- bannedBy: entry(audit.executor.id, renderUser(audit.executor)),
- reason: entry(audit.reason, audit.reason ? `\n> ${audit.reason}` : "*No reason provided.*"),
- accountCreated: entry(ban.user.createdAt, renderDelta(ban.user.createdAt)),
- serverMemberCount: ban.guild.memberCount,
- },
- hidden: {
- guild: ban.guild.id
- }
+ await statsChannelRemove(client, ban.user);
+ purgeByUser(ban.user.id, ban.guild);
+ const { log, NucleusColors, entry, renderUser, renderDelta, getAuditLog } = ban.user.client.logger;
+ const auditLog = await getAuditLog(ban.guild, "MEMBER_BAN_ADD");
+ const audit = auditLog.entries.filter(entry => entry.target.id === ban.user.id).first();
+ if (audit.executor.id === client.user.id) return;
+ await client.database.history.create("ban", ban.guild.id, ban.user, audit.executor, audit.reason);
+ const data = {
+ meta: {
+ type: "memberBan",
+ displayName: "Member Banned",
+ calculateType: "guildMemberPunish",
+ color: NucleusColors.red,
+ emoji: "PUNISH.BAN.RED",
+ timestamp: new Date().getTime()
+ },
+ list: {
+ memberId: entry(ban.user.id, `\`${ban.user.id}\``),
+ name: entry(ban.user.id, renderUser(ban.user)),
+ banned: entry(new Date().getTime(), renderDelta(new Date().getTime())),
+ bannedBy: entry(audit.executor.id, renderUser(audit.executor)),
+ reason: entry(audit.reason, audit.reason ? `\n> ${audit.reason}` : "*No reason provided.*"),
+ accountCreated: entry(ban.user.createdAt, renderDelta(ban.user.createdAt)),
+ serverMemberCount: ban.guild.memberCount
+ },
+ hidden: {
+ guild: ban.guild.id
}
- log(data);
- } catch {}
+ };
+ log(data);
}