@@ -284,13 +284,13 @@ class GuildChannelManager extends CachedManager {
284
284
* .catch(console.error);
285
285
*/
286
286
async edit ( channel , options ) {
287
- channel = this . resolve ( channel ) ;
288
- if ( ! channel ) throw new DiscordjsTypeError ( ErrorCodes . InvalidType , 'channel' , 'GuildChannelResolvable' ) ;
287
+ const resolvedChannel = this . resolve ( channel ) ;
288
+ if ( ! resolvedChannel ) throw new DiscordjsTypeError ( ErrorCodes . InvalidType , 'channel' , 'GuildChannelResolvable' ) ;
289
289
290
290
const parent = options . parent && this . client . channels . resolveId ( options . parent ) ;
291
291
292
292
if ( options . position !== undefined ) {
293
- await this . setPosition ( channel , options . position , { position : options . position , reason : options . reason } ) ;
293
+ await this . setPosition ( resolvedChannel , options . position , { position : options . position , reason : options . reason } ) ;
294
294
}
295
295
296
296
let permission_overwrites = options . permissionOverwrites ?. map ( overwrite =>
@@ -305,22 +305,22 @@ class GuildChannelManager extends CachedManager {
305
305
PermissionOverwrites . resolve ( overwrite , this . guild ) ,
306
306
) ;
307
307
}
308
- } else if ( channel . parent ) {
309
- permission_overwrites = channel . parent . permissionOverwrites . cache . map ( overwrite =>
308
+ } else if ( resolvedChannel . parent ) {
309
+ permission_overwrites = resolvedChannel . parent . permissionOverwrites . cache . map ( overwrite =>
310
310
PermissionOverwrites . resolve ( overwrite , this . guild ) ,
311
311
) ;
312
312
}
313
313
}
314
314
315
- const newData = await this . client . rest . patch ( Routes . channel ( channel . id ) , {
315
+ const newData = await this . client . rest . patch ( Routes . channel ( resolvedChannel . id ) , {
316
316
body : {
317
- name : ( options . name ?? channel . name ) . trim ( ) ,
317
+ name : options . name ,
318
318
type : options . type ,
319
319
topic : options . topic ,
320
320
nsfw : options . nsfw ,
321
- bitrate : options . bitrate ?? channel . bitrate ,
322
- user_limit : options . userLimit ?? channel . userLimit ,
323
- rtc_region : 'rtcRegion' in options ? options . rtcRegion : channel . rtcRegion ,
321
+ bitrate : options . bitrate ,
322
+ user_limit : options . userLimit ,
323
+ rtc_region : options . rtcRegion ,
324
324
video_quality_mode : options . videoQualityMode ,
325
325
parent_id : parent ,
326
326
lock_permissions : options . lockPermissions ,
0 commit comments