diff --git a/packages/discord.js/src/managers/GuildChannelManager.js b/packages/discord.js/src/managers/GuildChannelManager.js index bb64c832b..941c209b0 100644 --- a/packages/discord.js/src/managers/GuildChannelManager.js +++ b/packages/discord.js/src/managers/GuildChannelManager.js @@ -199,8 +199,8 @@ class GuildChannelManager extends CachedManager { } /** - * The data for a guild channel. - * @typedef {Object} ChannelData + * Options used to edit a guild channel. + * @typedef {Object} GuildChannelEditOptions * @property {string} [name] The name of the channel * @property {ChannelType} [type] The type of the channel (only conversion between text and news is supported) * @property {number} [position] The position of the channel @@ -224,7 +224,7 @@ class GuildChannelManager extends CachedManager { /** * Edits the channel. * @param {GuildChannelResolvable} channel The channel to edit - * @param {ChannelData} data The new data for the channel + * @param {GuildChannelEditOptions} data Options for editing the channel * @returns {Promise} * @example * // Edit a channel diff --git a/packages/discord.js/src/structures/GuildChannel.js b/packages/discord.js/src/structures/GuildChannel.js index 73c5bcf6e..e9504df81 100644 --- a/packages/discord.js/src/structures/GuildChannel.js +++ b/packages/discord.js/src/structures/GuildChannel.js @@ -264,7 +264,7 @@ class GuildChannel extends BaseChannel { /** * Edits the channel. - * @param {ChannelEditData} data The new data for the channel + * @param {GuildChannelEditOptions} data The new data for the channel * @returns {Promise} * @example * // Edit a channel diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 68da2f720..590b4ebe6 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -1248,7 +1248,7 @@ export abstract class GuildChannel extends BaseChannel { public get viewable(): boolean; public clone(options?: GuildChannelCloneOptions): Promise; public delete(reason?: string): Promise; - public edit(data: ChannelEditData): Promise; + public edit(data: GuildChannelEditOptions): Promise; public equals(channel: GuildChannel): boolean; public lockPermissions(): Promise; public permissionsFor(memberOrRole: GuildMember | Role, checkAdmin?: boolean): Readonly; @@ -3330,7 +3330,7 @@ export class GuildChannelManager extends CachedManager; public create(options: GuildChannelCreateOptions): Promise; public createWebhook(options: WebhookCreateOptions): Promise; - public edit(channel: GuildChannelResolvable, data: ChannelEditData): Promise; + public edit(channel: GuildChannelResolvable, data: GuildChannelEditOptions): Promise; public fetch(id: Snowflake, options?: BaseFetchOptions): Promise; public fetch(id?: undefined, options?: BaseFetchOptions): Promise>; public fetchWebhooks(channel: GuildChannelResolvable): Promise>; @@ -4011,27 +4011,6 @@ export interface ChannelCreationOverwrites { id: RoleResolvable | UserResolvable; } -export interface ChannelData { - name?: string; - type?: ChannelType.GuildText | ChannelType.GuildNews; - position?: number; - topic?: string | null; - nsfw?: boolean; - bitrate?: number; - userLimit?: number; - parent?: CategoryChannelResolvable | null; - rateLimitPerUser?: number; - lockPermissions?: boolean; - permissionOverwrites?: readonly OverwriteResolvable[] | Collection; - defaultAutoArchiveDuration?: ThreadAutoArchiveDuration; - rtcRegion?: string | null; - videoQualityMode?: VideoQualityMode | null; -} - -export interface ChannelEditData extends ChannelData { - reason?: string; -} - export type ChannelMention = `<#${Snowflake}>`; export interface ChannelPosition { @@ -4681,6 +4660,24 @@ export interface GuildChannelCloneOptions extends Omit; + defaultAutoArchiveDuration?: ThreadAutoArchiveDuration; + rtcRegion?: string | null; + videoQualityMode?: VideoQualityMode | null; + reason?: string; +} + export interface GuildChannelOverwriteOptions { reason?: string; type?: number;