diff --git a/modules/logging/misc.ts b/modules/logging/misc.ts index 59d1a71f5..50beb8ae4 100644 --- a/modules/logging/misc.ts +++ b/modules/logging/misc.ts @@ -108,12 +108,10 @@ export async function getLoggingThread(group?: LogGroup | typeof DATABASE_THREAD if (!config.channels.modlogs) throw new ReferenceError("Cannot find logs channel"); if (!group) return config.channels.modlogs; - const threads = await config.guild.channels.fetchActiveThreads(); + const threads = await config.channels.modlogs.threads.fetchActive(); return ( - threads.threads.find( - (thread) => thread.parent?.id === config.channels.modlogs?.id && thread.name === group, - ) || + threads.threads.find((thread) => thread.name === group) || (await config.channels.modlogs.threads.create({ name: group, reason: "New logging thread", diff --git a/modules/modInterestForm.ts b/modules/modInterestForm.ts index 754fefda1..bbb4ca1da 100644 --- a/modules/modInterestForm.ts +++ b/modules/modInterestForm.ts @@ -7,13 +7,9 @@ import constants from "../common/constants.js"; import giveXp from "./xp/giveXp.js"; if (!config.channels.admin) throw new ReferenceError("Could not find admin channel"); -const threads = await config.guild.channels.fetchActiveThreads(); +const threads = await config.channels.admin.threads.fetchActive(); const thread = - threads.threads.find( - (thread) => - thread.parent?.id === config.channels.admin?.id && - thread.name === "Moderator Interest Forms", - ) || + threads.threads.find((thread) => thread.name === "Moderator Interest Forms") || (await config.channels.admin.threads.create({ name: "Moderator Interest Forms", reason: "For mod interest forms", diff --git a/modules/tickets/misc.ts b/modules/tickets/misc.ts index 74f6e91f6..d441e7d1d 100644 --- a/modules/tickets/misc.ts +++ b/modules/tickets/misc.ts @@ -14,15 +14,12 @@ export async function getThreadFromMember( ): Promise { if (!config.channels.tickets) return; - const { threads } = await config.guild.channels.fetchActiveThreads(); + const { threads } = await config.channels.tickets.threads.fetchActive(); return ( await asyncFilter( threads.toJSON(), - async (thread) => - thread.parent?.id === config.channels.tickets?.id && - (await getUserFromTicket(thread))?.id === user.id && - thread, + async (thread) => (await getUserFromTicket(thread))?.id === user.id && thread, ).next() ).value; }