diff --git a/packages/discord.js/src/managers/GuildChannelManager.js b/packages/discord.js/src/managers/GuildChannelManager.js index 687816f97..27bd3e65c 100644 --- a/packages/discord.js/src/managers/GuildChannelManager.js +++ b/packages/discord.js/src/managers/GuildChannelManager.js @@ -204,6 +204,22 @@ class GuildChannelManager extends CachedManager { return channels; } + /** + * Data that can be resolved to give a Category Channel object. This can be: + * * A CategoryChannel object + * * A Snowflake + * @typedef {CategoryChannel|Snowflake} CategoryChannelResolvable + */ + + /** + * The data needed for updating a channel's position. + * @typedef {Object} ChannelPosition + * @property {GuildChannel|Snowflake} channel Channel to update + * @property {number} [position] New position for the channel + * @property {CategoryChannelResolvable} [parent] Parent channel for this channel + * @property {boolean} [lockPermissions] If the overwrites should be locked to the parents overwrites + */ + /** * Batch-updates the guild's channels' positions. * Only one channel's parent can be changed at a time diff --git a/packages/discord.js/src/managers/RoleManager.js b/packages/discord.js/src/managers/RoleManager.js index 94f35b4f0..8c96031e2 100644 --- a/packages/discord.js/src/managers/RoleManager.js +++ b/packages/discord.js/src/managers/RoleManager.js @@ -236,6 +236,13 @@ class RoleManager extends CachedManager { this.client.actions.GuildRoleDelete.handle({ guild_id: this.guild.id, role_id: id }); } + /* + * The data needed for updating a guild role's position + * @typedef {Object} GuildRolePosition + * @property {RoleResolvable} role The role's id + * @property {number} position The position to update + */ + /** * Batch-updates the guild's role positions * @param {GuildRolePosition[]} rolePositions Role positions to update diff --git a/packages/discord.js/src/structures/Guild.js b/packages/discord.js/src/structures/Guild.js index 4d0db2b0f..c26480843 100644 --- a/packages/discord.js/src/structures/Guild.js +++ b/packages/discord.js/src/structures/Guild.js @@ -36,8 +36,6 @@ const DataResolver = require('../util/DataResolver'); const SystemChannelFlags = require('../util/SystemChannelFlags'); const Util = require('../util/Util'); -let deprecationEmittedForSetChannelPositions = false; -let deprecationEmittedForSetRolePositions = false; let deprecationEmittedForDeleted = false; /** @@ -1219,76 +1217,6 @@ class Guild extends AnonymousGuild { return this.edit({ premiumProgressBarEnabled: enabled }, reason); } - /** - * Data that can be resolved to give a Category Channel object. This can be: - * * A CategoryChannel object - * * A Snowflake - * @typedef {CategoryChannel|Snowflake} CategoryChannelResolvable - */ - - /** - * The data needed for updating a channel's position. - * @typedef {Object} ChannelPosition - * @property {GuildChannel|Snowflake} channel Channel to update - * @property {number} [position] New position for the channel - * @property {CategoryChannelResolvable} [parent] Parent channel for this channel - * @property {boolean} [lockPermissions] If the overwrites should be locked to the parents overwrites - */ - - /** - * Batch-updates the guild's channels' positions. - * Only one channel's parent can be changed at a time - * @param {ChannelPosition[]} channelPositions Channel positions to update - * @returns {Promise} - * @deprecated Use {@link GuildChannelManager#setPositions} instead - * @example - * guild.setChannelPositions([{ channel: channelId, position: newChannelIndex }]) - * .then(guild => console.log(`Updated channel positions for ${guild}`)) - * .catch(console.error); - */ - setChannelPositions(channelPositions) { - if (!deprecationEmittedForSetChannelPositions) { - process.emitWarning( - 'The Guild#setChannelPositions method is deprecated. Use GuildChannelManager#setPositions instead.', - 'DeprecationWarning', - ); - - deprecationEmittedForSetChannelPositions = true; - } - - return this.channels.setPositions(channelPositions); - } - - /** - * The data needed for updating a guild role's position - * @typedef {Object} GuildRolePosition - * @property {RoleResolvable} role The role's id - * @property {number} position The position to update - */ - - /** - * Batch-updates the guild's role positions - * @param {GuildRolePosition[]} rolePositions Role positions to update - * @returns {Promise} - * @deprecated Use {@link RoleManager#setPositions} instead - * @example - * guild.setRolePositions([{ role: roleId, position: updatedRoleIndex }]) - * .then(guild => console.log(`Role positions updated for ${guild}`)) - * .catch(console.error); - */ - setRolePositions(rolePositions) { - if (!deprecationEmittedForSetRolePositions) { - process.emitWarning( - 'The Guild#setRolePositions method is deprecated. Use RoleManager#setPositions instead.', - 'DeprecationWarning', - ); - - deprecationEmittedForSetRolePositions = true; - } - - return this.roles.setPositions(rolePositions); - } - /** * Edits the guild's widget settings. * @param {GuildWidgetSettingsData} settings The widget settings for the guild diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 0ef9f3a5b..1abddc03b 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -946,8 +946,6 @@ export class Guild extends AnonymousGuild { public setAFKChannel(afkChannel: VoiceChannelResolvable | null, reason?: string): Promise; public setAFKTimeout(afkTimeout: number, reason?: string): Promise; public setBanner(banner: BufferResolvable | Base64Resolvable | null, reason?: string): Promise; - /** @deprecated Use {@link GuildChannelManager.setPositions} instead */ - public setChannelPositions(channelPositions: readonly ChannelPosition[]): Promise; public setDefaultMessageNotifications( defaultMessageNotifications: DefaultMessageNotificationLevel | number, reason?: string, @@ -965,8 +963,6 @@ export class Guild extends AnonymousGuild { public setOwner(owner: GuildMemberResolvable, reason?: string): Promise; public setPreferredLocale(preferredLocale: string, reason?: string): Promise; public setPublicUpdatesChannel(publicUpdatesChannel: TextChannelResolvable | null, reason?: string): Promise; - /** @deprecated Use {@link RoleManager.setPositions} instead */ - public setRolePositions(rolePositions: readonly RolePosition[]): Promise; public setRulesChannel(rulesChannel: TextChannelResolvable | null, reason?: string): Promise; public setSplash(splash: BufferResolvable | Base64Resolvable | null, reason?: string): Promise; public setSystemChannel(systemChannel: TextChannelResolvable | null, reason?: string): Promise;