mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Docs: document ChannelData.parent and .permissionOverwrites, fix typedefs to not include Collection of ChannelCreationOverwrite (#2734)
* document ChannelData.parent * document ChannelData.permissionOverwrites * Overwrites also take other things, account for it * note to self: stop copy-pasting * remove eslint madness, fix param defs * fix property slip
This commit is contained in:
@@ -714,17 +714,16 @@ class Guild {
|
||||
return this.edit({ explicitContentFilter }, reason);
|
||||
}
|
||||
|
||||
/* eslint-disable max-len */
|
||||
/**
|
||||
* Edits the setting of the default message notifications of the guild.
|
||||
* @param {DefaultMessageNotifications|number} defaultMessageNotifications The new setting for the default message notifications
|
||||
* @param {DefaultMessageNotifications|number} defaultMessageNotifications
|
||||
* The new setting for the default message notifications
|
||||
* @param {string} [reason] Reason for changing the setting of the default message notifications
|
||||
* @returns {Promise<Guild>}
|
||||
*/
|
||||
setDefaultMessageNotifications(defaultMessageNotifications, reason) {
|
||||
return this.edit({ defaultMessageNotifications }, reason);
|
||||
}
|
||||
/* eslint-enable max-len */
|
||||
|
||||
/**
|
||||
* Edit the name of the guild.
|
||||
@@ -968,7 +967,7 @@ class Guild {
|
||||
}
|
||||
|
||||
/**
|
||||
* Can be used to overwrite permissions when creating a channel or replacing overwrites.
|
||||
* Overwrites to use when creating a channel or replacing overwrites
|
||||
* @typedef {Object} ChannelCreationOverwrites
|
||||
* @property {PermissionResolvable} [allow] The permissions to allow
|
||||
* **(deprecated)**
|
||||
@@ -976,14 +975,14 @@ class Guild {
|
||||
* @property {PermissionResolvable} [deny] The permissions to deny
|
||||
* **(deprecated)**
|
||||
* @property {PermissionResolvable} [denied] The permissions to deny
|
||||
* @property {RoleResolvable|UserResolvable} id ID of the role or member this overwrite is for
|
||||
* @property {GuildMemberResolvable|RoleResolvable} memberOrRole Member or role this overwrite is for
|
||||
*/
|
||||
|
||||
/**
|
||||
* Creates a new channel in the guild.
|
||||
* @param {string} name The name of the new channel
|
||||
* @param {string} [type='text'] The type of the new channel, either `text` or `voice` or `category`
|
||||
* @param {Array<PermissionOverwrites|ChannelCreationOverwrites>} [overwrites] Permission overwrites
|
||||
* @param {ChannelCreationOverwrites[]|Collection<Snowflake, PermissionOverwrites>} [overwrites] Permission overwrites
|
||||
* @param {string} [reason] Reason for creating this channel
|
||||
* @returns {Promise<CategoryChannel|TextChannel|VoiceChannel>}
|
||||
* @example
|
||||
|
||||
@@ -159,11 +159,11 @@ class GuildChannel extends Channel {
|
||||
};
|
||||
}
|
||||
|
||||
/* eslint-disable max-len */
|
||||
/**
|
||||
* Replaces the permission overwrites for a channel
|
||||
* @param {Object} [options] Options
|
||||
* @param {Array<PermissionOverwrites|ChannelCreationOverwrites>|Collection<Snowflake, ChannelCreationOverwrites>} [options.overwrites] Permission overwrites
|
||||
* @param {ChannelCreationOverwrites[]|Collection<Snowflake, PermissionOverwrites>} [options.overwrites]
|
||||
* Permission overwrites
|
||||
* @param {string} [options.reason] Reason for updating the channel overwrites
|
||||
* @returns {Promise<GuildChannel>}
|
||||
* @example
|
||||
@@ -181,7 +181,6 @@ class GuildChannel extends Channel {
|
||||
return this.edit({ permissionOverwrites: overwrites, reason })
|
||||
.then(() => this);
|
||||
}
|
||||
/* eslint-enable max-len */
|
||||
|
||||
/**
|
||||
* An object mapping permission flags to `true` (enabled), `null` (unset) or `false` (disabled).
|
||||
@@ -283,6 +282,9 @@ class GuildChannel extends Channel {
|
||||
* @property {boolean} [nsfw] Whether the channel is NSFW
|
||||
* @property {number} [bitrate] The bitrate of the voice channel
|
||||
* @property {number} [userLimit] The user limit of the channel
|
||||
* @property {string} [parent] The parent ID of the channel
|
||||
* @property {ChannelCreationOverwrites[]|Collection<Snowflake, PermissionOverwrites>} [overwrites]
|
||||
* Overwrites of the channel
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user