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