more types
diff --git a/src/events/channelCreate.ts b/src/events/channelCreate.ts
index 19f5c9b..2aa8ec7 100644
--- a/src/events/channelCreate.ts
+++ b/src/events/channelCreate.ts
@@ -1,9 +1,13 @@
+import type { GuildAuditLogsEntry } from "discord.js";
+import type { GuildBasedChannel } from "discord.js";
+// @ts-expect-error
+import { HaikuClient } from "jshaiku";
export const event = "channelCreate";
-export async function callback(client, channel) {
- const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderChannel } = channel.client.logger;
+export async function callback(client: HaikuClient, channel: GuildBasedChannel) {
+ const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderChannel } = client.logger;
const auditLog = await getAuditLog(channel.guild, "CHANNEL_CREATE");
- const audit = auditLog.entries.filter((entry) => entry.target.id === channel.id).first();
+ const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === channel.id).first();
if (audit.executor.id === client.user.id) return;
let emoji;
let readableType;
@@ -27,7 +31,7 @@
displayName = "Voice Channel";
break;
}
- case "GUILD_STAGE": {
+ case "GUILD_STAGE_VOICE": {
emoji = "CHANNEL.VOICE.CREATE";
readableType = "Stage";
displayName = "Stage Channel";
diff --git a/src/events/channelDelete.ts b/src/events/channelDelete.ts
index f39e7ed..d42a12a 100644
--- a/src/events/channelDelete.ts
+++ b/src/events/channelDelete.ts
@@ -1,7 +1,7 @@
import {
BaseGuildTextChannel,
- BaseGuildVoiceChannel,
- GuildChannel,
+ GuildAuditLogsEntry,
+ GuildBasedChannel,
StageChannel,
ThreadChannel,
VoiceChannel
@@ -11,10 +11,12 @@
import getEmojiByName from "../utils/getEmojiByName.js";
export const event = "channelDelete";
+
+export async function callback(client: HaikuClient, channel: GuildBasedChannel) {
const { getAuditLog, log, NucleusColors, entry, renderDelta, renderUser } = client.logger;
const auditLog = await getAuditLog(channel.guild, "CHANNEL_DELETE");
- const audit = auditLog.entries.filter((entry) => entry.target.id === channel.id).first();
+ const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === channel.id).first();
if (audit.executor.id === client.user.id) return;
let emoji;
@@ -46,15 +48,15 @@
}
}
const list: {
- channelId: string;
- name: string;
- topic?: string | null;
- type: any;
- category: any;
- nsfw?: boolean | null;
- created: any;
- deleted: any;
- deletedBy: any;
+ channelId: { value: string; displayValue: string };
+ name: { value: string; displayValue: string };
+ topic?: { value: string; displayValue: string } | null;
+ type: { value: string; displayValue: string };
+ category: { value: string; displayValue: string };
+ nsfw?: { value: string; displayValue: string } | null;
+ created: { value: string; displayValue: string };
+ deleted: { value: string; displayValue: string };
+ deletedBy: { value: string; displayValue: string };
} = {
channelId: entry(channel.id, `\`${channel.id}\``),
name: entry(channel.id, `${channel.name}`),