fixed events/* (not including webhookUpdate.ts)
diff --git a/src/commands/settings/tickets.ts b/src/commands/settings/tickets.ts
index ee0f2d1..bf4b42a 100644
--- a/src/commands/settings/tickets.ts
+++ b/src/commands/settings/tickets.ts
@@ -10,9 +10,9 @@
Component,
ButtonBuilder,
MessageComponentInteraction,
- SelectMenuBuilder,
+ StringSelectMenuBuilder,
Role,
- SelectMenuInteraction,
+ StringSelectMenuInteraction,
TextInputComponent,
ButtonStyle
} from "discord.js";
@@ -69,10 +69,10 @@
fetchReply: true
})) as Message;
const options = {
- enabled: interaction.options.getString("enabled")?.startsWith("yes") as boolean | null,
- category: interaction.options.getChannel("category"),
- maxtickets: interaction.options.getNumber("maxticketsperuser"),
- supportping: interaction.options.getRole("supportrole")
+ enabled: (interaction.options.get("enabled")?.value as string).startsWith("yes") as boolean | null,
+ category: interaction.options.get("category")?.channel,
+ maxtickets: interaction.options.get("maxticketsperuser")?.value as number,
+ supportping: interaction.options.get("supportrole")?.role as Role
};
if (options.enabled !== null || options.category || options.maxtickets || options.supportping) {
if (options.category) {
@@ -337,7 +337,7 @@
],
components: [
new ActionRowBuilder().addComponents([
- new SelectMenuBuilder()
+ new StringSelectMenuBuilder()
.setOptions(
ticketMessages.map(
(
@@ -392,9 +392,9 @@
await interaction.channel!.send({
embeds: [
new EmojiEmbed()
- .setTitle(ticketMessages[parseInt((i as SelectMenuInteraction).values[0]!)]!.label)
+ .setTitle(ticketMessages[parseInt((i as StringSelectMenuInteraction).values[0]!)]!.label)
.setDescription(
- ticketMessages[parseInt((i as SelectMenuInteraction).values[0]!)]!.description
+ ticketMessages[parseInt((i as StringSelectMenuInteraction).values[0]!)]!.description
)
.setStatus("Success")
.setEmoji("GUILD.TICKET.OPEN")
@@ -546,7 +546,7 @@
components: (customTypes
? [
new ActionRowBuilder().addComponents([
- new Discord.SelectMenuBuilder()
+ new Discord.StringSelectMenuBuilder()
.setCustomId("removeTypes")
.setPlaceholder("Select types to remove")
.setMaxValues(customTypes.length)
@@ -585,7 +585,7 @@
const options = [];
ticketTypes.forEach((type) => {
options.push(
- new SelectMenuOption({
+ new StringSelectMenuOption({
label: capitalize(type),
value: type,
emoji: client.emojis.cache.get(getEmojiByName(`TICKETS.${type.toUpperCase()}`, "id")),
@@ -594,7 +594,7 @@
);
});
const selectPane = new ActionRowBuilder().addComponents([
- new Discord.SelectMenuBuilder()
+ new Discord.StringSelectMenuBuilder()
.addOptions(options)
.setCustomId("types")
.setMaxValues(ticketTypes.length)
diff --git a/src/events/guildMemberUpdate.ts b/src/events/guildMemberUpdate.ts
index 440d786..e30fc35 100644
--- a/src/events/guildMemberUpdate.ts
+++ b/src/events/guildMemberUpdate.ts
@@ -6,15 +6,15 @@
export async function callback(client: NucleusClient, before: GuildMember, after: GuildMember) {
try {
const { log, NucleusColors, entry, renderUser, renderDelta, getAuditLog } = client.logger;
- const auditLog = await getAuditLog(after.guild, AuditLogEvent.MemberUpdate);
- const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === after.id).first();
- if (audit.executor.id === client.user!.id) return;
+ const auditLog = (await getAuditLog(after.guild, AuditLogEvent.EmojiCreate))
+ .filter((entry: GuildAuditLogsEntry) => (entry.target as GuildMember)!.id === after.id)[0]!;
+ if (auditLog.executor!.id === client.user!.id) return;
if (before.nickname !== after.nickname) {
await client.database.history.create(
"nickname",
after.guild.id,
after.user,
- audit.executor,
+ auditLog.executor,
null,
before.nickname ?? before.user.username,
after.nickname ?? after.user.username
@@ -34,7 +34,7 @@
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))
+ changedBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!))
},
hidden: {
guild: after.guild.id
@@ -49,8 +49,8 @@
"mute",
after.guild.id,
after.user,
- audit.executor,
- audit.reason,
+ auditLog.executor,
+ auditLog.reason,
null,
null,
null
@@ -69,18 +69,18 @@
name: entry(after.user.id, renderUser(after.user)),
mutedUntil: entry(
after.communicationDisabledUntilTimestamp,
- renderDelta(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*")
+ mutedBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
+ reason: entry(auditLog.reason, auditLog.reason ? auditLog.reason : "\n> *No reason provided*")
},
hidden: {
guild: after.guild.id
}
};
log(data);
- client.database.eventScheduler.schedule("naturalUnmute", after.communicationDisabledUntil, {
+ client.database.eventScheduler.schedule("naturalUnmute", after.communicationDisabledUntil?.toISOString()!, {
guild: after.guild.id,
user: after.id,
expires: after.communicationDisabledUntilTimestamp
@@ -88,13 +88,13 @@
} else if (
after.communicationDisabledUntil === null &&
before.communicationDisabledUntilTimestamp !== null &&
- new Date().getTime() >= audit.createdTimestamp
+ new Date().getTime() >= auditLog.createdTimestamp
) {
await client.database.history.create(
"unmute",
after.guild.id,
after.user,
- audit.executor,
+ auditLog.executor,
null,
null,
null,
@@ -113,7 +113,7 @@
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))
+ unmutedBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!))
},
hidden: {
guild: after.guild.id
diff --git a/src/events/guildUpdate.ts b/src/events/guildUpdate.ts
index eefab4b..8690af2 100644
--- a/src/events/guildUpdate.ts
+++ b/src/events/guildUpdate.ts
@@ -1,66 +1,67 @@
import type { NucleusClient } from "../utils/client.js";
-import type { Guild, GuildAuditLogsEntry } from "discord.js";
+import { AuditLogEvent, Guild, GuildAuditLogsEntry } from "discord.js";
import { callback as statsChannelUpdate } from "../reflex/statsChannelUpdate.js";
export const event = "guildUpdate";
export async function callback(client: NucleusClient, before: Guild, after: Guild) {
- await statsChannelUpdate(client, after.me!);
+ await statsChannelUpdate(client, after.members.me!);
const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta } = client.logger;
- const auditLog = await getAuditLog(after, "GUILD_UPDATE");
- const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === after.id).first();
- if (audit.executor.id === client.user.id) return;
+ const auditLog = (await getAuditLog(after, AuditLogEvent.GuildUpdate))
+ .filter((entry: GuildAuditLogsEntry) => (entry.target as Guild)!.id === after.id)[0]!;
+ if (auditLog.executor!.id === client.user!.id) return;
const list: Record<string, ReturnType<typeof entry>> = {};
- const verificationLevels = {
- NONE: "Unrestricted",
- LOW: "Verified email",
- MEDIUM: "Registered (5 minutes)",
- HIGH: "Member (10 minutes)",
- VERY_HIGH: "Verified phone"
- };
+ const verificationLevels = [
+ "Unrestricted",
+ "Verified email",
+ "Registered (5 minutes)",
+ "Member (10 minutes)",
+ "Verified phone"
+ ];
- const explicitContentFilterLevels = {
- DISABLED: "Disabled",
- MEMBERS_WITHOUT_ROLES: "Members without roles",
- ALL_MEMBERS: "All members"
- };
+ const explicitContentFilterLevels = [
+ "Disabled",
+ "Members without roles",
+ "All members"
+ ];
- const MFALevels = {
- NONE: "None",
- ELEVATED: "Enabled"
- };
+ const MFALevels = [
+ "None",
+ "Enabled"
+ ];
+
const beforeOwner = await before.fetchOwner();
const afterOwner = await after.fetchOwner();
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()})`);
+ 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.splash!, after.splash!],
`[Before](${before.splashURL()}) -> [After](${after.splashURL()})`
);
if (before.banner !== after.banner)
list["banner"] = entry(
- [before.banner, after.banner],
+ [before.banner!, after.banner!],
`[Before](${before.bannerURL()}) -> [After](${after.bannerURL()})`
);
if (beforeOwner !== afterOwner)
list["owner"] = entry(
- [beforeOwner, afterOwner],
+ [beforeOwner.id, afterOwner.id],
`${renderUser(beforeOwner.user)} -> ${renderUser(afterOwner.user)}`
);
if (before.verificationLevel !== after.verificationLevel)
list["verificationLevel"] = entry(
- [verificationLevels[before.verificationLevel], verificationLevels[after.verificationLevel]],
- `${verificationLevels[before.verificationLevel]} -> ${verificationLevels[after.verificationLevel]}`
+ [verificationLevels[before.verificationLevel.valueOf()]!, verificationLevels[before.verificationLevel.valueOf()]!],
+ `${verificationLevels[before.verificationLevel.valueOf()]} -> ${verificationLevels[before.verificationLevel.valueOf()]}`
);
if (before.explicitContentFilter !== after.explicitContentFilter)
list["explicitContentFilter"] = entry(
[
- explicitContentFilterLevels[before.explicitContentFilter],
- explicitContentFilterLevels[after.explicitContentFilter]
+ explicitContentFilterLevels[before.explicitContentFilter.valueOf()]!,
+ explicitContentFilterLevels[after.explicitContentFilter.valueOf()]!
],
`${explicitContentFilterLevels[before.explicitContentFilter]} -> ${
explicitContentFilterLevels[after.explicitContentFilter]
@@ -68,13 +69,13 @@
);
if (before.mfaLevel !== after.mfaLevel)
list["2 factor authentication"] = entry(
- [MFALevels[before.mfaLevel], MFALevels[after.mfaLevel]],
- `${MFALevels[before.mfaLevel]} -> ${MFALevels[after.mfaLevel]}`
+ [MFALevels[before.mfaLevel.valueOf()]!, MFALevels[after.mfaLevel.valueOf()]!],
+ `${MFALevels[before.mfaLevel.valueOf()]} -> ${MFALevels[after.mfaLevel.valueOf()]}`
);
if (!Object.keys(list).length) return;
list["updated"] = entry(new Date().getTime(), renderDelta(new Date().getTime()));
- list["updatedBy"] = entry(audit.executor.id, renderUser(audit.executor));
+ list["updatedBy"] = entry(auditLog.executor!.id, renderUser(auditLog.executor!));
const data = {
meta: {
type: "guildUpdate",
diff --git a/src/events/inviteCreate.ts b/src/events/inviteCreate.ts
index 7dbf8a7..a267f09 100644
--- a/src/events/inviteCreate.ts
+++ b/src/events/inviteCreate.ts
@@ -1,4 +1,4 @@
-import type { GuildAuditLogsEntry, Invite } from "discord.js";
+import { AuditLogEvent, Guild, GuildAuditLogsEntry, GuildChannel, Invite } from "discord.js";
// @ts-expect-error
import humanizeDuration from "humanize-duration";
import type { NucleusClient } from "../utils/client.js";
@@ -6,12 +6,11 @@
export const event = "inviteCreate";
export async function callback(client: NucleusClient, invite: Invite) {
+ if(!invite.guild) return; // This is a DM invite (not a guild invite
const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderChannel } = client.logger;
- const auditLog = await getAuditLog(invite.guild, "INVITE_CREATE");
- const audit = auditLog.entries
- .filter((entry: GuildAuditLogsEntry) => entry.target!.id === invite.inviterId)
- .first();
- if (audit.executor.id === client.user.id) return;
+ const auditLog = (await getAuditLog(invite.guild as Guild, AuditLogEvent.InviteCreate))
+ .filter((entry: GuildAuditLogsEntry) => (entry.target as Invite)!.code === invite.code)[0]!;
+ if (auditLog.executor!.id === client.user!.id) return;
const data = {
meta: {
type: "inviteCreate",
@@ -22,11 +21,11 @@
timestamp: invite.createdTimestamp
},
list: {
- channel: entry(invite.channel.id, renderChannel(invite.channel)),
+ channel: entry(invite.channel!.id, renderChannel(invite.channel as GuildChannel)),
link: entry(invite.url, invite.url),
expires: entry(invite.maxAge, invite.maxAge ? humanizeDuration(invite.maxAge * 1000) : "Never"),
- createdBy: entry(audit.executor.id, renderUser(audit.executor)),
- created: entry(invite.createdTimestamp, renderDelta(invite.createdTimestamp))
+ createdBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
+ created: entry(invite.createdTimestamp, renderDelta(invite.createdTimestamp!))
},
hidden: {
guild: invite.guild!.id
diff --git a/src/events/inviteDelete.ts b/src/events/inviteDelete.ts
index e74ad15..1ded432 100644
--- a/src/events/inviteDelete.ts
+++ b/src/events/inviteDelete.ts
@@ -1,4 +1,4 @@
-import type { GuildAuditLogsEntry, Invite } from "discord.js";
+import { AuditLogEvent, Guild, GuildAuditLogsEntry, GuildChannel, Invite } from "discord.js";
// @ts-expect-error
import humanizeDuration from "humanize-duration";
import type { NucleusClient } from "../utils/client.js";
@@ -6,12 +6,11 @@
export const event = "inviteDelete";
export async function callback(client: NucleusClient, invite: Invite) {
+ if(!invite.guild) return; // This is a DM invite (not a guild invite
const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderChannel } = client.logger;
- const auditLog = await getAuditLog(invite.guild, "INVITE_DELETE");
- const audit = auditLog.entries
- .filter((entry: GuildAuditLogsEntry) => entry.target!.id === invite.inviterId)
- .first();
- if (audit.executor.id === client.user.id) return;
+ const auditLog = (await getAuditLog(invite.guild as Guild, AuditLogEvent.InviteDelete))
+ .filter((entry: GuildAuditLogsEntry) => (entry.target as Invite)!.code === invite.code)[0]!;
+ if (auditLog.executor!.id === client.user!.id) return;
const data = {
meta: {
type: "inviteDelete",
@@ -22,10 +21,10 @@
timestamp: new Date().getTime()
},
list: {
- channel: entry(invite.channel.id, renderChannel(invite.channel)),
+ channel: entry(invite.channel!.id, renderChannel(invite.channel as GuildChannel)),
link: entry(invite.url, invite.url),
expires: entry(invite.maxAge, invite.maxAge ? humanizeDuration(invite.maxAge * 1000) : "Never"),
- deletedBy: entry(audit.executor.id, renderUser(audit.executor)),
+ deletedBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
deleted: entry(new Date().getTime(), renderDelta(new Date().getTime()))
},
hidden: {
diff --git a/src/events/memberJoin.ts b/src/events/memberJoin.ts
index 93c9186..daf195a 100644
--- a/src/events/memberJoin.ts
+++ b/src/events/memberJoin.ts
@@ -22,8 +22,8 @@
list: {
memberId: entry(member.id, `\`${member.id}\``),
name: entry(member.id, renderUser(member.user)),
- joined: entry(member.joinedAt, renderDelta(member.joinedAt)),
- accountCreated: entry(member.user.createdAt, renderDelta(member.user.createdAt)),
+ joined: entry(member.joinedTimestamp, renderDelta(member.joinedTimestamp?.valueOf()!)),
+ accountCreated: entry(member.user.createdTimestamp, renderDelta(member.user.createdTimestamp.valueOf()!)),
serverMemberCount: member.guild.memberCount
},
hidden: {
diff --git a/src/events/memberLeave.ts b/src/events/memberLeave.ts
index 4731d58..936f8c2 100644
--- a/src/events/memberLeave.ts
+++ b/src/events/memberLeave.ts
@@ -1,4 +1,4 @@
-import type { GuildAuditLogsEntry, GuildMember } from "discord.js";
+import { AuditLogEvent, Guild, GuildAuditLogsEntry, GuildMember } from "discord.js";
import type { NucleusClient } from "../utils/client.js";
import { purgeByUser } from "../actions/tickets/delete.js";
@@ -7,21 +7,21 @@
export const event = "guildMemberRemove";
export async function callback(client: NucleusClient, member: GuildMember) {
- purgeByUser(member.id, member.guild);
+ purgeByUser(member.id, member.guild.id);
await statsChannelRemove(client, member);
const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta } = client.logger;
- const auditLog = await getAuditLog(member.guild, "MEMBER_KICK");
- const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === member.id).first();
+ const auditLog = (await getAuditLog(member.guild as Guild, AuditLogEvent.MemberKick))
+ .filter((entry: GuildAuditLogsEntry) => (entry.target as GuildMember)!.id === member.id)[0]!;
let type = "leave";
- if (audit) {
- if (audit.executor.id === client.user.id) return;
- if (audit.createdAt - 100 >= new Date().getTime()) {
+ if (auditLog) {
+ if (auditLog.executor!.id === client.user!.id) return;
+ if (auditLog.createdAt.valueOf() - 100 >= new Date().getTime()) {
type = "kick";
}
}
let data;
if (type === "kick") {
- await client.database.history.create("kick", member.guild.id, member.user, audit.executor, audit.reason);
+ await client.database.history.create("kick", member.guild.id, member.user, auditLog.executor, auditLog.reason);
data = {
meta: {
type: "memberKick",
@@ -34,11 +34,11 @@
list: {
memberId: entry(member.id, `\`${member.id}\``),
name: entry(member.id, renderUser(member.user)),
- joined: entry(member.joinedAt, renderDelta(member.joinedAt)),
+ joined: entry(member.joinedTimestamp, renderDelta(member.joinedTimestamp?.valueOf()!)),
kicked: entry(new Date().getTime(), renderDelta(new Date().getTime())),
- kickedBy: entry(audit.executor.id, renderUser(audit.executor)),
- reason: entry(audit.reason, audit.reason ? `\n> ${audit.reason}` : "*No reason provided.*"),
- accountCreated: entry(member.user.createdAt, renderDelta(member.user.createdAt)),
+ kickedBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
+ reason: entry(auditLog.reason, auditLog.reason ? `\n> ${auditLog.reason}` : "*No reason provided.*"),
+ accountCreated: entry(member.user.createdTimestamp, renderDelta(member.user.createdTimestamp)),
serverMemberCount: member.guild.memberCount
},
hidden: {
@@ -59,9 +59,9 @@
list: {
memberId: entry(member.id, `\`${member.id}\``),
name: entry(member.id, renderUser(member.user)),
- joined: entry(member.joinedTimestamp, renderDelta(member.joinedAt)),
+ joined: entry(member.joinedTimestamp, renderDelta(member.joinedTimestamp?.valueOf()!)),
left: entry(new Date().getTime(), renderDelta(new Date().getTime())),
- accountCreated: entry(member.user.createdAt, renderDelta(member.user.createdAt)),
+ accountCreated: entry(member.user.createdTimestamp, renderDelta(member.user.createdTimestamp)),
serverMemberCount: member.guild.memberCount
},
hidden: {
diff --git a/src/events/roleCreate.ts b/src/events/roleCreate.ts
index 25e9c98..d253ce7 100644
--- a/src/events/roleCreate.ts
+++ b/src/events/roleCreate.ts
@@ -1,14 +1,14 @@
import type { NucleusClient } from "../utils/client.js";
-import type { GuildAuditLogsEntry, Role } from "discord.js";
+import { AuditLogEvent, Guild, GuildAuditLogsEntry, Role } from "discord.js";
export const event = "roleCreate";
export async function callback(client: NucleusClient, role: Role) {
const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderRole } = client.logger;
if (role.managed) return;
- const auditLog = await getAuditLog(role.guild, "ROLE_CREATE");
- const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === role.id).first();
- if (audit.executor.id === client.user.id) return;
+ const auditLog = (await getAuditLog(role.guild as Guild, AuditLogEvent.RoleCreate))
+ .filter((entry: GuildAuditLogsEntry) => (entry.target as Role)!.id === role.id)[0]!;
+ if (auditLog.executor!.id === client.user!.id) return;
const data = {
meta: {
type: "roleCreate",
@@ -21,7 +21,7 @@
list: {
roleId: entry(role.id, `\`${role.id}\``),
role: entry(role.name, renderRole(role)),
- createdBy: entry(audit.executor.id, renderUser(audit.executor)),
+ createdBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
created: entry(role.createdTimestamp, renderDelta(role.createdTimestamp))
},
hidden: {
diff --git a/src/events/roleDelete.ts b/src/events/roleDelete.ts
index 4c89565..f41241b 100644
--- a/src/events/roleDelete.ts
+++ b/src/events/roleDelete.ts
@@ -1,15 +1,15 @@
import getEmojiByName from "../utils/getEmojiByName.js";
import type { NucleusClient } from "../utils/client.js";
-import type { GuildAuditLogsEntry, Role } from "discord.js";
+import { AuditLogEvent, Guild, GuildAuditLogsEntry, Role } from "discord.js";
export const event = "roleDelete";
export async function callback(client: NucleusClient, role: Role) {
const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta } = client.logger;
if (role.managed) return;
- const auditLog = await getAuditLog(role.guild, "ROLE_DELETE");
- const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === role.id).first();
- if (audit.executor.id === client.user.id) return;
+ const auditLog = (await getAuditLog(role.guild as Guild, AuditLogEvent.RoleDelete))
+ .filter((entry: GuildAuditLogsEntry) => (entry.target as Role)!.id === role.id)[0]!;
+ if (auditLog.executor!.id === client.user!.id) return;
const data = {
meta: {
type: "roleDelete",
@@ -17,7 +17,7 @@
calculateType: "guildRoleUpdate",
color: NucleusColors.red,
emoji: "GUILD.ROLES.DELETE",
- timestamp: audit.createdTimestamp
+ timestamp: auditLog.createdTimestamp
},
list: {
roleId: entry(role.id, `\`${role.id}\``),
@@ -32,7 +32,7 @@
role.mentionable ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`
),
members: entry(role.members.size, `${role.members.size}`),
- deletedBy: entry(audit.executor.id, renderUser(audit.executor)),
+ deletedBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
created: entry(role.createdTimestamp, renderDelta(role.createdTimestamp)),
deleted: entry(new Date().getTime(), renderDelta(new Date().getTime()))
},
diff --git a/src/events/roleUpdate.ts b/src/events/roleUpdate.ts
index fc26d6c..924ec3e 100644
--- a/src/events/roleUpdate.ts
+++ b/src/events/roleUpdate.ts
@@ -1,36 +1,36 @@
-import type { Role } from "discord.js";
+import { AuditLogEvent, Guild, GuildAuditLogsEntry, Role } from "discord.js";
import type { NucleusClient } from "../utils/client.js";
import getEmojiByName from "../utils/getEmojiByName.js";
export const event = "roleUpdate";
-export async function callback(client: NucleusClient, or: Role, nr: Role) {
+export async function callback(client: NucleusClient, oldRole: Role, newRole: Role) {
const { getAuditLog, log, NucleusColors, entry, renderDelta, renderUser, renderRole } = client.logger;
- const auditLog = await getAuditLog(nr.guild, "ROLE_UPDATE");
- const audit = auditLog.entries.first();
- if (audit.executor.id === client.user.id) return;
+ const auditLog = (await getAuditLog(newRole.guild as Guild, AuditLogEvent.RoleUpdate))
+ .filter((entry: GuildAuditLogsEntry) => (entry.target as Role)!.id === newRole.id)[0]!;
+ if (auditLog.executor!.id === client.user!.id) return;
const changes: Record<string, ReturnType<typeof entry>> = {
- roleId: entry(nr.id, `\`${nr.id}\``),
- role: entry(nr.id, renderRole(nr)),
+ roleId: entry(newRole.id, `\`${newRole.id}\``),
+ role: entry(newRole.id, renderRole(newRole)),
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(auditLog.executor!.id, renderUser((await newRole.guild.members.fetch(auditLog.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] = oldRole.mentionable ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`;
+ mentionable[1] = newRole.mentionable ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`;
+ hoist[0] = oldRole.hoist ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`;
+ hoist[1] = newRole.hoist ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`;
+ if (oldRole.name !== newRole.name) changes["name"] = entry([oldRole.name, newRole.name], `${oldRole.name} -> ${newRole.name}`);
+ if (oldRole.position !== newRole.position)
+ changes["position"] = entry([oldRole.position.toString(), newRole.position.toString()], `${oldRole.position} -> ${newRole.position}`);
+ if (oldRole.hoist !== newRole.hoist) changes["showInMemberList"] = entry([oldRole.hoist, newRole.hoist], `${hoist[0]} -> ${hoist[1]}`);
+ if (oldRole.mentionable !== newRole.mentionable)
+ changes["mentionable"] = entry([oldRole.mentionable, newRole.mentionable], `${mentionable[0]} -> ${mentionable[1]}`);
+ if (oldRole.hexColor !== newRole.hexColor)
+ changes["color"] = entry([oldRole.hexColor, newRole.hexColor], `\`${oldRole.hexColor}\` -> \`${newRole.hexColor}\``);
if (Object.keys(changes).length === 4) return;
@@ -41,11 +41,11 @@
calculateType: "guildRoleUpdate",
color: NucleusColors.yellow,
emoji: "GUILD.ROLES.EDIT",
- timestamp: audit.createdTimestamp
+ timestamp: auditLog.createdTimestamp
},
list: changes,
hidden: {
- guild: nr.guild.id
+ guild: newRole.guild.id
}
}; // TODO: show perms changed (webpage)
log(data);
diff --git a/src/events/stickerCreate.ts b/src/events/stickerCreate.ts
index 295d48b..7dcaf5a 100644
--- a/src/events/stickerCreate.ts
+++ b/src/events/stickerCreate.ts
@@ -1,13 +1,13 @@
import type { NucleusClient } from "../utils/client.js";
-import type { GuildAuditLogsEntry, Sticker } from "discord.js";
+import { AuditLogEvent, GuildAuditLogsEntry, Sticker } from "discord.js";
export const event = "stickerDelete";
-export async function callback(client: NucleusClient, emoji: Sticker) {
+export async function callback(client: NucleusClient, sticker: Sticker) {
const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta } = client.logger;
- const auditLog = await getAuditLog(emoji.guild, "STICKER_CREATE");
- const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === emoji.id).first();
- if (audit.executor.id === client.user.id) return;
+ const auditLog = (await getAuditLog(sticker.guild!, AuditLogEvent.EmojiCreate))
+ .filter((entry: GuildAuditLogsEntry) => (entry.target as Sticker)!.id === sticker.id)[0] as GuildAuditLogsEntry;
+ if (auditLog.executor!.id === client.user!.id) return;
const data = {
meta: {
type: "stickerCreate",
@@ -15,16 +15,16 @@
calculateType: "stickerUpdate",
color: NucleusColors.green,
emoji: "GUILD.EMOJI.CREATE",
- timestamp: emoji.createdTimestamp
+ timestamp: sticker.createdTimestamp
},
list: {
- stickerId: entry(emoji.id, `\`${emoji.id}\``),
- emoji: entry(emoji.name, `\`:${emoji.name}:\``),
- createdBy: entry(audit.executor.id, renderUser(audit.executor)),
- created: entry(emoji.createdTimestamp, renderDelta(emoji.createdTimestamp))
+ stickerId: entry(sticker.id, `\`${sticker.id}\``),
+ emoji: entry(sticker.name, `\`:${sticker.name}:\``),
+ createdBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
+ created: entry(sticker.createdTimestamp, renderDelta(sticker.createdTimestamp))
},
hidden: {
- guild: emoji.guild!.id
+ guild: sticker.guild!.id
}
};
log(data);
diff --git a/src/events/stickerDelete.ts b/src/events/stickerDelete.ts
index fed99e6..3f1b741 100644
--- a/src/events/stickerDelete.ts
+++ b/src/events/stickerDelete.ts
@@ -1,31 +1,31 @@
import type { NucleusClient } from "../utils/client.js";
-import type { GuildAuditLogsEntry, Sticker } from "discord.js";
+import { AuditLogEvent, GuildAuditLogsEntry, Sticker } from "discord.js";
export const event = "stickerDelete";
-export async function callback(client: NucleusClient, emoji: Sticker) {
+export async function callback(client: NucleusClient, sticker: Sticker) {
const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta } = client.logger;
- const auditLog = await getAuditLog(emoji.guild, "STICKER_DELETE");
- const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === emoji.id).first();
- if (audit.executor.id === client.user.id) return;
+ const auditLog = (await getAuditLog(sticker.guild!, AuditLogEvent.StickerDelete))
+ .filter((entry: GuildAuditLogsEntry) => (entry.target as Sticker)!.id === sticker.id)[0] as GuildAuditLogsEntry;
+ if (auditLog.executor!.id === client.user!.id) return;
const data = {
meta: {
type: "stickerDelete",
displayName: "Sticker Deleted",
calculateType: "stickerUpdate",
color: NucleusColors.red,
- emoji: "GUILD.EMOJI.DELETE",
- timestamp: audit.createdTimestamp
+ sticker: "GUILD.sticker.DELETE",
+ timestamp: auditLog.createdTimestamp
},
list: {
- stickerId: entry(emoji.id, `\`${emoji.id}\``),
- sticker: entry(emoji.name, `\`${emoji.name}\``),
- deletedBy: entry(audit.executor.id, renderUser(audit.executor)),
- created: entry(emoji.createdTimestamp, renderDelta(emoji.createdTimestamp)),
- deleted: entry(audit.createdTimestamp, renderDelta(audit.createdTimestamp))
+ stickerId: entry(sticker.id, `\`${sticker.id}\``),
+ sticker: entry(sticker.name, `\`${sticker.name}\``),
+ deletedBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
+ created: entry(sticker.createdTimestamp, renderDelta(sticker.createdTimestamp)),
+ deleted: entry(auditLog.createdTimestamp, renderDelta(auditLog.createdTimestamp))
},
hidden: {
- guild: emoji.guild!.id
+ guild: sticker.guild!.id
}
};
log(data);
diff --git a/src/events/stickerUpdate.ts b/src/events/stickerUpdate.ts
index 0ac000e..cc11726 100644
--- a/src/events/stickerUpdate.ts
+++ b/src/events/stickerUpdate.ts
@@ -1,21 +1,21 @@
import type { NucleusClient } from "../utils/client.js";
-import type { Sticker } from "discord.js";
+import { AuditLogEvent, GuildAuditLogsEntry, Sticker } from "discord.js";
export const event = "stickerUpdate";
-export async function callback(client: NucleusClient, oe: Sticker, ne: Sticker) {
+export async function callback(client: NucleusClient, oldSticker: Sticker, newSticker: Sticker) {
const { getAuditLog, log, NucleusColors, entry, renderDelta, renderUser } = client.logger;
- if (oe.name === ne.name) return;
- const auditLog = await getAuditLog(ne.guild, "STICKER_UPDATE");
- const audit = auditLog.entries.first();
- if (audit.executor.id === client.user.id) return;
+ if (oldSticker.name === newSticker.name) return;
+ const auditLog = (await getAuditLog(newSticker.guild!, AuditLogEvent.StickerUpdate))
+ .filter((entry: GuildAuditLogsEntry) => (entry.target as Sticker)!.id === newSticker.id)[0] as GuildAuditLogsEntry;
+ if (auditLog.executor!.id === client.user!.id) return;
const changes = {
- stickerId: entry(ne.id, `\`${ne.id}\``),
- edited: entry(ne.createdTimestamp, renderDelta(ne.createdTimestamp)),
- editedBy: entry(audit.executor.id, renderUser((await ne.guild!.members.fetch(audit.executor.id)).user)),
- name: entry([oe.name, ne.name], `\`:${oe.name}:\` -> \`:${ne.name}:\``)
+ stickerId: entry(newSticker.id, `\`${newSticker.id}\``),
+ edited: entry(newSticker.createdTimestamp, renderDelta(newSticker.createdTimestamp)),
+ editedBy: entry(auditLog.executor!.id, renderUser((await newSticker.guild!.members.fetch(auditLog.executor!.id)).user)),
+ name: entry([oldSticker.name, newSticker.name], `\`:${oldSticker.name}:\` -> \`:${newSticker.name}:\``)
};
const data = {
meta: {
@@ -24,11 +24,11 @@
calculateType: "stickerUpdate",
color: NucleusColors.yellow,
emoji: "GUILD.EMOJI.EDIT",
- timestamp: audit.createdTimestamp
+ timestamp: auditLog.createdTimestamp
},
list: changes,
hidden: {
- guild: ne.guild!.id
+ guild: newSticker.guild!.id
}
};
log(data);
diff --git a/src/events/threadCreate.ts b/src/events/threadCreate.ts
index 1f1b758..14516b3 100644
--- a/src/events/threadCreate.ts
+++ b/src/events/threadCreate.ts
@@ -1,4 +1,4 @@
-import type { GuildAuditLogsEntry, ThreadChannel } from "discord.js";
+import { AuditLogEvent, GuildAuditLogsEntry, ThreadChannel } from "discord.js";
// @ts-expect-error
import humanizeDuration from "humanize-duration";
import type { NucleusClient } from "../utils/client.js";
@@ -6,9 +6,9 @@
export async function callback(client: NucleusClient, thread: ThreadChannel) {
const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderChannel } = client.logger;
- const auditLog = await getAuditLog(thread.guild, "THREAD_CREATE");
- const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === thread.id).first();
- if (audit.executor.id === client.user.id) return;
+ const auditLog = (await getAuditLog(thread.guild, AuditLogEvent.ThreadCreate))
+ .filter((entry: GuildAuditLogsEntry) => (entry.target as ThreadChannel)!.id === thread.id)[0] as GuildAuditLogsEntry;
+ if (auditLog.executor!.id === client.user!.id) return;
const category = thread.parent
? entry(
thread.parent.parent ? thread.parent.parent.name : "None",
@@ -27,7 +27,7 @@
list: {
threadId: entry(thread.id, `\`${thread.id}\``),
name: entry(thread.name, renderChannel(thread)),
- parentChannel: entry(thread.parentId, renderChannel(thread.parent)),
+ parentChannel: entry(thread.parentId, renderChannel(thread.parent!)),
category: category,
autoArchiveDuration: entry(
thread.autoArchiveDuration,
@@ -35,8 +35,8 @@
round: true
})
),
- createdBy: entry(audit.executor.id, renderUser(audit.executor)),
- created: entry(thread.createdTimestamp, renderDelta(thread.createdTimestamp))
+ createdBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
+ created: entry(thread.createdTimestamp, renderDelta(thread.createdTimestamp!))
},
hidden: {
guild: thread.guild.id
diff --git a/src/events/threadDelete.ts b/src/events/threadDelete.ts
index cdc89ee..1957e80 100644
--- a/src/events/threadDelete.ts
+++ b/src/events/threadDelete.ts
@@ -1,4 +1,4 @@
-import type { GuildAuditLogsEntry, ThreadChannel } from "discord.js";
+import { AuditLogEvent, GuildAuditLogsEntry, ThreadChannel } from "discord.js";
// @ts-expect-error
import humanizeDuration from "humanize-duration";
import type { NucleusClient } from "../utils/client.js";
@@ -6,9 +6,9 @@
export async function callback(client: NucleusClient, thread: ThreadChannel) {
const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderChannel } = client.logger;
- const auditLog = await getAuditLog(thread.guild, "THREAD_UPDATE");
- const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === thread.id).first();
- if (audit.executor.id === client.user.id) return;
+ const auditLog = (await getAuditLog(thread.guild, AuditLogEvent.ThreadDelete))
+ .filter((entry: GuildAuditLogsEntry) => (entry.target as ThreadChannel)!.id === thread.id)[0] as GuildAuditLogsEntry;
+ if (auditLog.executor!.id === client.user!.id) return;
const category = thread.parent
? entry(
thread.parent.parent ? thread.parent.parent.name : "None",
@@ -35,9 +35,9 @@
round: true
})
),
- membersInThread: entry(thread.memberCount, thread.memberCount),
- deletedBy: entry(audit.executor.id, renderUser(audit.executor)),
- created: entry(thread.createdTimestamp, renderDelta(thread.createdTimestamp)),
+ membersInThread: entry(thread.memberCount, thread.memberCount!.toString()),
+ deletedBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
+ created: entry(thread.createdTimestamp, renderDelta(thread.createdTimestamp!)),
deleted: entry(new Date().getTime(), renderDelta(new Date().getTime()))
},
hidden: {
diff --git a/src/events/threadUpdate.ts b/src/events/threadUpdate.ts
index 9125fcb..bcf73fa 100644
--- a/src/events/threadUpdate.ts
+++ b/src/events/threadUpdate.ts
@@ -1,44 +1,44 @@
-import type { GuildAuditLogsEntry, ThreadChannel } from "discord.js";
+import { AuditLogEvent, GuildAuditLogsEntry, ThreadChannel } from "discord.js";
// @ts-expect-error
import humanizeDuration from "humanize-duration";
import type { NucleusClient } from "../utils/client.js";
export const event = "threadUpdate";
-export async function callback(client: NucleusClient, before: ThreadChannel, after: ThreadChannel) {
+export async function callback(client: NucleusClient, oldThread: ThreadChannel, newThread: ThreadChannel) {
const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderChannel } = client.logger;
- const auditLog = await getAuditLog(after.guild, "THREAD_UPDATE");
- const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === after.id).first();
- if (audit.executor.id === client.user.id) return;
+ const auditLog = (await getAuditLog(newThread.guild, AuditLogEvent.ThreadUpdate))
+ .filter((entry: GuildAuditLogsEntry) => (entry.target as ThreadChannel)!.id === newThread.id)[0] as GuildAuditLogsEntry;
+ if (auditLog.executor!.id === client.user!.id) return;
const list: Record<string, ReturnType<typeof entry>> = {
- threadId: entry(after.id, `\`${after.id}\``),
- thread: entry(after.name, renderChannel(after)),
- parentChannel: entry(after.parentId, renderChannel(after.parent))
+ threadId: entry(newThread.id, `\`${newThread.id}\``),
+ thread: entry(newThread.name, renderChannel(newThread)),
+ parentChannel: entry(newThread.parentId, renderChannel(newThread.parent!))
};
- if (before.name !== after.name) {
- list["name"] = entry([before.name, after.name], `${before.name} -> ${after.name}`);
+ if (oldThread.name !== newThread.name) {
+ list["name"] = entry([oldThread.name, newThread.name], `${oldThread.name} -> ${newThread.name}`);
}
- if (before.autoArchiveDuration !== after.autoArchiveDuration) {
+ if (oldThread.autoArchiveDuration !== newThread.autoArchiveDuration) {
list["autoArchiveDuration"] = entry(
- [before.autoArchiveDuration, after.autoArchiveDuration],
- `${humanizeDuration((before.autoArchiveDuration ?? 0) * 60 * 1000, {
+ [oldThread.autoArchiveDuration!.toString(), newThread.autoArchiveDuration!.toString()],
+ `${humanizeDuration((oldThread.autoArchiveDuration ?? 0) * 60 * 1000, {
round: true
- })} -> ${humanizeDuration((after.autoArchiveDuration ?? 0) * 60 * 1000, {
+ })} -> ${humanizeDuration((newThread.autoArchiveDuration ?? 0) * 60 * 1000, {
round: true
})}`
);
}
- if (before.rateLimitPerUser !== after.rateLimitPerUser) {
+ if (oldThread.rateLimitPerUser !== newThread.rateLimitPerUser) {
list["slowmode"] = entry(
- [before.rateLimitPerUser, after.rateLimitPerUser],
- `${humanizeDuration((before.rateLimitPerUser ?? 0) * 1000)} -> ${humanizeDuration(
- (after.rateLimitPerUser ?? 0) * 1000
+ [oldThread.rateLimitPerUser!.toString(), newThread.rateLimitPerUser!.toString()],
+ `${humanizeDuration((oldThread.rateLimitPerUser ?? 0) * 1000)} -> ${humanizeDuration(
+ (newThread.rateLimitPerUser ?? 0) * 1000
)}`
);
}
if (!(Object.keys(list).length - 3)) return;
list["updated"] = entry(new Date().getTime(), renderDelta(new Date().getTime()));
- list["updatedBy"] = entry(audit.executor.id, renderUser(audit.executor));
+ list["updatedBy"] = entry(auditLog.executor!.id, renderUser(auditLog.executor!));
const data = {
meta: {
type: "channelUpdate",
@@ -50,7 +50,7 @@
},
list: list,
hidden: {
- guild: after.guild.id
+ guild: newThread.guild.id
}
};
log(data);
diff --git a/src/events/webhookUpdate.ts b/src/events/webhookUpdate.ts
index a991c66..18b6d46 100644
--- a/src/events/webhookUpdate.ts
+++ b/src/events/webhookUpdate.ts
@@ -1,4 +1,4 @@
-import type { GuildAuditLogsEntry, Webhook } from "discord.js";
+import { AuditLogEvent, GuildAuditLogsEntry, Webhook } from "discord.js";
import type Discord from "discord.js";
import type { NucleusClient } from "../utils/client.js";
export const event = "webhookUpdate";
@@ -6,32 +6,13 @@
export async function callback(client: NucleusClient, channel: Discord.GuildChannel) {
try {
const { getAuditLog, log, NucleusColors, entry, renderUser, renderChannel, renderDelta } = client.logger;
- let auditLogCreate = getAuditLog(channel.guild, "WEBHOOK_CREATE");
- let auditLogUpdate = getAuditLog(channel.guild, "WEBHOOK_UPDATE");
- let auditLogDelete = getAuditLog(channel.guild, "WEBHOOK_DELETE");
- [auditLogCreate, auditLogUpdate, auditLogDelete] = await Promise.all([
- auditLogCreate,
- auditLogUpdate,
- auditLogDelete
- ]);
- const auditCreate = auditLogCreate.entries
- .filter((entry: GuildAuditLogsEntry | null) => {
- if (entry === null) return false;
- return (entry.target! as Webhook).channelId === channel.id;
- })
- .first();
- const auditUpdate = auditLogUpdate.entries
- .filter((entry: GuildAuditLogsEntry | null) => {
- if (entry === null) return false;
- return (entry.target! as Webhook).channelId === channel.id;
- })
- .first();
- const auditDelete = auditLogDelete.entries
- .filter((entry: GuildAuditLogsEntry | null) => {
- if (entry === null) return false;
- return (entry.target! as Webhook).channelId === channel.id;
- })
- .first();
+ const auditCreate = (await getAuditLog(channel.guild, AuditLogEvent.WebhookCreate))
+ .filter((entry: GuildAuditLogsEntry) => (entry.target as Webhook)!.id === channel.id)[0] as GuildAuditLogsEntry;
+ const auditDelete = (await getAuditLog(channel.guild, AuditLogEvent.WebhookDelete))
+ .filter((entry: GuildAuditLogsEntry) => (entry.target as Webhook)!.id === channel.id)[0] as GuildAuditLogsEntry;
+ const auditUpdate = (await getAuditLog(channel.guild, AuditLogEvent.WebhookUpdate))
+ .filter((entry: GuildAuditLogsEntry) => (entry.target as Webhook)!.id === channel.id)[0] as GuildAuditLogsEntry;
+
if (!auditCreate && !auditUpdate && !auditDelete) return;
let audit = auditCreate;
let action: "Create" | "Update" | "Delete" = "Create";
diff --git a/src/utils/log.ts b/src/utils/log.ts
index d4e2a82..54f656a 100644
--- a/src/utils/log.ts
+++ b/src/utils/log.ts
@@ -25,7 +25,7 @@
const delta = num2 - num1;
return `${num1} -> ${num2} (${delta > 0 ? "+" : ""}${delta})`;
},
- entry(value: string | number | boolean | null | string[], displayValue: string): { value: string | boolean | null | string[]; displayValue: string } {
+ entry(value: string | number | boolean | null | (string | boolean)[], displayValue: string): { value: string | boolean | null | (string | boolean | number)[]; displayValue: string } {
if (typeof value === "number") value = value.toString();
return { value: value, displayValue: displayValue };
},