Bug fixes and ~~performance~~ typing improvements
diff --git a/src/events/threadDelete.ts b/src/events/threadDelete.ts
index 0077eff..bfae11a 100644
--- a/src/events/threadDelete.ts
+++ b/src/events/threadDelete.ts
@@ -2,19 +2,9 @@
export const event = "threadDelete";
export async function callback(client, thread) {
- const {
- getAuditLog,
- log,
- NucleusColors,
- entry,
- renderUser,
- renderDelta,
- renderChannel
- } = thread.client.logger;
+ const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderChannel } = thread.client.logger;
const auditLog = await getAuditLog(thread.guild, "THREAD_UPDATE");
- const audit = auditLog.entries
- .filter((entry) => entry.target.id === thread.id)
- .first();
+ const audit = auditLog.entries.filter((entry) => entry.target.id === thread.id).first();
if (audit.executor.id === client.user.id) return;
const data = {
meta: {
@@ -31,9 +21,7 @@
parentChannel: entry(thread.parentId, renderChannel(thread.parent)),
category: entry(
thread.parent.parent ? thread.parent.parent.name : "None",
- thread.parent.parent
- ? renderChannel(thread.parent.parent)
- : "None"
+ thread.parent.parent ? renderChannel(thread.parent.parent) : "None"
),
autoArchiveDuration: entry(
thread.autoArchiveDuration,
@@ -43,14 +31,8 @@
),
membersInThread: entry(thread.memberCount, thread.memberCount),
deletedBy: entry(audit.executor.id, renderUser(audit.executor)),
- created: entry(
- thread.createdTimestamp,
- renderDelta(thread.createdTimestamp)
- ),
- deleted: entry(
- new Date().getTime(),
- renderDelta(new Date().getTime())
- )
+ created: entry(thread.createdTimestamp, renderDelta(thread.createdTimestamp)),
+ deleted: entry(new Date().getTime(), renderDelta(new Date().getTime()))
},
hidden: {
guild: thread.guild.id