From 310563ba0797c11f68a5d50617423a5634102515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Leit=C3=A3o?= <38259440+ImRodry@users.noreply.github.com> Date: Mon, 9 Dec 2024 08:51:39 +0000 Subject: [PATCH] refactor(GuildChannel)!: default setParent's lockPermissions to false (#9016) BREAKING CHANGE: `GuildChannel#setParent`'s `lockPermissions` now defaults to false --- packages/discord.js/src/structures/GuildChannel.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/discord.js/src/structures/GuildChannel.js b/packages/discord.js/src/structures/GuildChannel.js index e0e9ee027..4f7894176 100644 --- a/packages/discord.js/src/structures/GuildChannel.js +++ b/packages/discord.js/src/structures/GuildChannel.js @@ -316,7 +316,7 @@ class GuildChannel extends BaseChannel { /** * Options used to set the parent of a channel. * @typedef {Object} SetParentOptions - * @property {boolean} [lockPermissions=true] Whether to lock the permissions to what the parent's permissions are + * @property {boolean} [lockPermissions=false] Whether to lock the permissions to what the parent's permissions are * @property {string} [reason] The reason for modifying the parent of the channel */ @@ -327,11 +327,16 @@ class GuildChannel extends BaseChannel { * @returns {Promise} * @example * // Add a parent to a channel - * message.channel.setParent('355908108431917066', { lockPermissions: false }) - * .then(channel => console.log(`New parent of ${message.channel.name}: ${channel.name}`)) + * message.channel.setParent('355908108431917066') + * .then(channel => console.log(`New parent of ${channel.name}: ${channel.parent.name}`)) + * .catch(console.error); + * @example + * // Move a channel and sync its permissions with the parent + * message.channel.setParent('355908108431917066', { lockPermissions: true }) + * .then(channel => console.log(`Moved ${message.channel.name} to ${channel.parent.name}`)) * .catch(console.error); */ - setParent(channel, { lockPermissions = true, reason } = {}) { + setParent(channel, { lockPermissions = false, reason } = {}) { return this.edit({ parent: channel ?? null, lockPermissions,