mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Docs: merge PermissionOverwriteOptions and OverwriteData (#2738)
* Docs: merge PermissionOverwriteOptions and OverwriteData * fix user-member and replace eslint-disable with linebreaks * consistency fix * Fix: remove empty line between jsdocs and method * Fix: allowed/denied to allow/deny to conform with recent master changes
This commit is contained in:
@@ -21,14 +21,6 @@ class GuildChannelStore extends DataStore {
|
||||
return Channel.create(this.client, data, this.guild);
|
||||
}
|
||||
|
||||
/**
|
||||
* Can be used to overwrite permissions when creating a channel.
|
||||
* @typedef {Object} PermissionOverwriteOptions
|
||||
* @property {PermissionResolvable} [allow] The permissions to allow
|
||||
* @property {PermissionResolvable} [deny] The permissions to deny
|
||||
* @property {RoleResolvable|UserResolvable} id ID of the role or member this overwrite is for
|
||||
*/
|
||||
|
||||
/**
|
||||
* Creates a new channel in the guild.
|
||||
* @param {string} name The name of the new channel
|
||||
@@ -39,7 +31,8 @@ class GuildChannelStore extends DataStore {
|
||||
* @param {number} [options.bitrate] Bitrate of the new channel in bits (only voice)
|
||||
* @param {number} [options.userLimit] Maximum amount of users allowed in the new channel (only voice)
|
||||
* @param {ChannelResolvable} [options.parent] Parent of the new channel
|
||||
* @param {Array<PermissionOverwrites|PermissionOverwriteOptions>} [options.overwrites] Permission overwrites
|
||||
* @param {OverwriteData[]|Collection<Snowflake, PermissionOverwrites>} [options.overwrites]
|
||||
* Permission overwrites of the new channel
|
||||
* @param {string} [options.reason] Reason for creating the channel
|
||||
* @returns {Promise<GuildChannel>}
|
||||
* @example
|
||||
|
||||
@@ -176,11 +176,11 @@ class GuildChannel extends Channel {
|
||||
.freeze();
|
||||
}
|
||||
|
||||
/* eslint-disable max-len */
|
||||
/**
|
||||
* Replaces the permission overwrites in this channel.
|
||||
* @param {Object} [options] Options
|
||||
* @param {Array<PermissionOverwrites|PermissionOverwriteOptions>|Collection<Snowflake, PermissionOverwriteOptions>} [options.overwrites] Permission overwrites
|
||||
* @param {OverwriteData[]|Collection<Snowflake, PermissionOverwrites>} [options.overwrites]
|
||||
* Permission overwrites the channel gets updated with
|
||||
* @param {string} [options.reason] Reason for updating the channel overwrites
|
||||
* @returns {Promise<GuildChannel>}
|
||||
* @example
|
||||
@@ -198,7 +198,6 @@ class GuildChannel extends Channel {
|
||||
return this.edit({ permissionOverwrites: resolvePermissions.call(this, overwrites), reason })
|
||||
.then(() => this);
|
||||
}
|
||||
/* eslint-enable max-len */
|
||||
|
||||
/**
|
||||
* An object mapping permission flags to `true` (enabled), `null` (unset) or `false` (disabled).
|
||||
@@ -307,17 +306,18 @@ class GuildChannel extends Channel {
|
||||
* @property {number} [bitrate] The bitrate of the voice channel
|
||||
* @property {number} [userLimit] The user limit of the voice channel
|
||||
* @property {Snowflake} [parentID] The parent ID of the channel
|
||||
* @property {boolean} [lockPermissions] Lock the permissions of the channel to what the parent's permissions are
|
||||
* @property {OverwriteData[]} [permissionOverwrites] An array of overwrites to set for the channel
|
||||
* @property {boolean} [lockPermissions]
|
||||
* Lock the permissions of the channel to what the parent's permissions are
|
||||
* @property {OverwriteData[]|Collection<Snowflake, PermissionOverwrites>} [permissionOverwrites]
|
||||
* Permission overwrites for the channel
|
||||
*/
|
||||
|
||||
/**
|
||||
* The data for a permission overwrite
|
||||
* @typedef {Object} OverwriteData
|
||||
* @property {string} id The id of the overwrite
|
||||
* @property {string} type The type of the overwrite, either role or member
|
||||
* @property {number} allow The bitfield for the allowed permissions
|
||||
* @property {number} deny The bitfield for the denied permissions
|
||||
* @property {PermissionResolvable} [allow] The permissions to allow
|
||||
* @property {PermissionResolvable} [deny] The permissions to deny
|
||||
* @property {GuildMemberResolvable|RoleResolvable} memberOrRole Member or role this overwrite is for
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user