Skip to content

Commit add992c

Browse files
committed
Revert "workaround for discordjs/discord.js#9648... again *sigh*"
This reverts commit b5fd0ec.
1 parent 197908f commit add992c

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

modules/logging/misc.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,10 @@ 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.guild.channels.fetchActiveThreads();
111+
const threads = await config.channels.modlogs.threads.fetchActive();
112112

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

modules/modInterestForm.ts

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

99
if (!config.channels.admin) throw new ReferenceError("Could not find admin channel");
10-
const threads = await config.guild.channels.fetchActiveThreads();
10+
const threads = await config.channels.admin.threads.fetchActive();
1111
const thread =
12-
threads.threads.find(
13-
(thread) =>
14-
thread.parent?.id === config.channels.admin?.id &&
15-
thread.name === "Moderator Interest Forms",
16-
) ||
12+
threads.threads.find((thread) => thread.name === "Moderator Interest Forms") ||
1713
(await config.channels.admin.threads.create({
1814
name: "Moderator Interest Forms",
1915
reason: "For mod interest forms",

modules/tickets/misc.ts

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

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

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

0 commit comments

Comments
 (0)