Skip to content

Commit b5fd0ec

Browse files
committed
workaround for discordjs/discord.js#9648... again *sigh*
Signed-off-by: RedGuy12 <paul@reid-family.org>
1 parent 8aee9e8 commit b5fd0ec

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

modules/logging/misc.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,12 @@ export async function getLoggingThread(group?: LogGroup | typeof DATABASE_THREAD
108108
if (!config.channels.modlogs) throw new ReferenceError("Cannot find logs channel");
109109
if (!group) return config.channels.modlogs;
110110

111-
const threads = await config.channels.modlogs.threads.fetchActive();
111+
const threads = await config.guild.channels.fetchActiveThreads();
112112

113113
return (
114-
threads.threads.find((thread) => thread.name === group) ||
114+
threads.threads.find(
115+
(thread) => thread.parent?.id === config.channels.modlogs?.id && thread.name === group,
116+
) ||
115117
(await config.channels.modlogs.threads.create({
116118
name: group,
117119
reason: "New logging thread",

modules/modInterestForm.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ import constants from "../common/constants.js";
88
import giveXp from "./xp/giveXp.js";
99

1010
if (!config.channels.admin) throw new ReferenceError("Could not find admin channel");
11-
const threads = await config.channels.admin.threads.fetchActive();
11+
const threads = await config.guild.channels.fetchActiveThreads();
1212
const thread =
13-
threads.threads.find((thread) => thread.name === "Moderator Interest Forms") ||
13+
threads.threads.find(
14+
(thread) =>
15+
thread.parent?.id === config.channels.admin?.id &&
16+
thread.name === "Moderator Interest Forms",
17+
) ||
1418
(await config.channels.admin.threads.create({
1519
name: "Moderator Interest Forms",
1620
reason: "For mod interest forms",

modules/tickets/misc.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ export async function getThreadFromMember(
1414
): Promise<ThreadChannel | void> {
1515
if (!config.channels.tickets) return;
1616

17-
const { threads } = await config.channels.tickets.threads.fetchActive();
17+
const { threads } = await config.guild.channels.fetchActiveThreads();
1818

1919
return (
2020
await asyncFilter(
2121
threads.toJSON(),
22-
async (thread) => (await getUserFromTicket(thread))?.id === user.id && thread,
22+
async (thread) =>
23+
thread.parent?.id === config.channels.tickets?.id &&
24+
(await getUserFromTicket(thread))?.id === user.id &&
25+
thread,
2326
).next()
2427
).value;
2528
}

0 commit comments

Comments
 (0)