File tree Expand file tree Collapse file tree 3 files changed +6
-15
lines changed Expand file tree Collapse file tree 3 files changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -108,12 +108,10 @@ export async function getLoggingThread(group?: LogGroup | typeof DATABASE_THREAD
108
108
if ( ! config . channels . modlogs ) throw new ReferenceError ( "Cannot find logs channel" ) ;
109
109
if ( ! group ) return config . channels . modlogs ;
110
110
111
- const threads = await config . guild . channels . fetchActiveThreads ( ) ;
111
+ const threads = await config . channels . modlogs . threads . fetchActive ( ) ;
112
112
113
113
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 ) ||
117
115
( await config . channels . modlogs . threads . create ( {
118
116
name : group ,
119
117
reason : "New logging thread" ,
Original file line number Diff line number Diff line change @@ -7,13 +7,9 @@ import constants from "../common/constants.js";
7
7
import giveXp from "./xp/giveXp.js" ;
8
8
9
9
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 ( ) ;
11
11
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" ) ||
17
13
( await config . channels . admin . threads . create ( {
18
14
name : "Moderator Interest Forms" ,
19
15
reason : "For mod interest forms" ,
Original file line number Diff line number Diff line change @@ -14,15 +14,12 @@ export async function getThreadFromMember(
14
14
) : Promise < ThreadChannel | void > {
15
15
if ( ! config . channels . tickets ) return ;
16
16
17
- const { threads } = await config . guild . channels . fetchActiveThreads ( ) ;
17
+ const { threads } = await config . channels . tickets . threads . fetchActive ( ) ;
18
18
19
19
return (
20
20
await asyncFilter (
21
21
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 ,
26
23
) . next ( )
27
24
) . value ;
28
25
}
You can’t perform that action at this time.
0 commit comments