@@ -84,7 +84,7 @@ class GuildChannelManager extends CachedManager {
84
84
* @returns {?(GuildChannel|ThreadChannel) }
85
85
*/
86
86
resolve ( channel ) {
87
- if ( channel instanceof ThreadChannel ) return super . resolve ( channel . id ) ;
87
+ if ( channel instanceof ThreadChannel ) return super . cache . get ( channel . id ) ?? null ;
88
88
return super . resolve ( channel ) ;
89
89
}
90
90
@@ -287,7 +287,7 @@ class GuildChannelManager extends CachedManager {
287
287
const resolvedChannel = this . resolve ( channel ) ;
288
288
if ( ! resolvedChannel ) throw new DiscordjsTypeError ( ErrorCodes . InvalidType , 'channel' , 'GuildChannelResolvable' ) ;
289
289
290
- const parent = options . parent && this . client . channels . resolveId ( options . parent ) ;
290
+ const parentId = options . parent && this . client . channels . resolveId ( options . parent ) ;
291
291
292
292
if ( options . position !== undefined ) {
293
293
await this . setPosition ( resolvedChannel , options . position , { position : options . position , reason : options . reason } ) ;
@@ -298,8 +298,8 @@ class GuildChannelManager extends CachedManager {
298
298
) ;
299
299
300
300
if ( options . lockPermissions ) {
301
- if ( parent ) {
302
- const newParent = this . resolve ( parent ) ;
301
+ if ( parentId ) {
302
+ const newParent = this . cache . get ( parentId ) ;
303
303
if ( newParent ?. type === ChannelType . GuildCategory ) {
304
304
permission_overwrites = newParent . permissionOverwrites . cache . map ( overwrite =>
305
305
PermissionOverwrites . resolve ( overwrite , this . guild ) ,
@@ -322,7 +322,7 @@ class GuildChannelManager extends CachedManager {
322
322
user_limit : options . userLimit ,
323
323
rtc_region : options . rtcRegion ,
324
324
video_quality_mode : options . videoQualityMode ,
325
- parent_id : parent ,
325
+ parent_id : parentId ,
326
326
lock_permissions : options . lockPermissions ,
327
327
rate_limit_per_user : options . rateLimitPerUser ,
328
328
default_auto_archive_duration : options . defaultAutoArchiveDuration ,
0 commit comments