mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +01:00
docs: small changes regarding permissions/overwrites (#2718)
* Add Collection as param to GuildChannel#replacePermissionOverwrites * Add example for null to PermissionOverwriteOptions * eslint-disable max-len * PermissionOverwriteOptions desc. change default to unset * deprecated allow/deny in favor of allowed/denied
This commit is contained in:
@@ -971,8 +971,10 @@ class Guild {
|
|||||||
* Can be used to overwrite permissions when creating a channel or replacing overwrites.
|
* Can be used to overwrite permissions when creating a channel or replacing overwrites.
|
||||||
* @typedef {Object} ChannelCreationOverwrites
|
* @typedef {Object} ChannelCreationOverwrites
|
||||||
* @property {PermissionResolvable} [allow] The permissions to allow
|
* @property {PermissionResolvable} [allow] The permissions to allow
|
||||||
|
* **(deprecated)**
|
||||||
* @property {PermissionResolvable} [allowed] The permissions to allow
|
* @property {PermissionResolvable} [allowed] The permissions to allow
|
||||||
* @property {PermissionResolvable} [deny] The permissions to deny
|
* @property {PermissionResolvable} [deny] The permissions to deny
|
||||||
|
* **(deprecated)**
|
||||||
* @property {PermissionResolvable} [denied] The permissions to deny
|
* @property {PermissionResolvable} [denied] The permissions to deny
|
||||||
* @property {RoleResolvable|UserResolvable} id ID of the role or member this overwrite is for
|
* @property {RoleResolvable|UserResolvable} id ID of the role or member this overwrite is for
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -159,10 +159,11 @@ class GuildChannel extends Channel {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* eslint-disable max-len */
|
||||||
/**
|
/**
|
||||||
* Replaces the permission overwrites for a channel
|
* Replaces the permission overwrites for a channel
|
||||||
* @param {Object} [options] Options
|
* @param {Object} [options] Options
|
||||||
* @param {Array<PermissionOverwrites|ChannelCreationOverwrites>} [options.overwrites] Permission overwrites
|
* @param {Array<PermissionOverwrites|ChannelCreationOverwrites>|Collection<Snowflake, ChannelCreationOverwrites>} [options.overwrites] Permission overwrites
|
||||||
* @param {string} [options.reason] Reason for updating the channel overwrites
|
* @param {string} [options.reason] Reason for updating the channel overwrites
|
||||||
* @returns {Promise<GuildChannel>}
|
* @returns {Promise<GuildChannel>}
|
||||||
* @example
|
* @example
|
||||||
@@ -180,12 +181,14 @@ class GuildChannel extends Channel {
|
|||||||
return this.edit({ permissionOverwrites: overwrites, reason })
|
return this.edit({ permissionOverwrites: overwrites, reason })
|
||||||
.then(() => this);
|
.then(() => this);
|
||||||
}
|
}
|
||||||
|
/* eslint-enable max-len */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An object mapping permission flags to `true` (enabled), `false` (disabled), or `null` (not set).
|
* An object mapping permission flags to `true` (enabled), `null` (unset) or `false` (disabled).
|
||||||
* ```js
|
* ```js
|
||||||
* {
|
* {
|
||||||
* 'SEND_MESSAGES': true,
|
* 'SEND_MESSAGES': true,
|
||||||
|
* 'EMBED_LINKS': null,
|
||||||
* 'ATTACH_FILES': false,
|
* 'ATTACH_FILES': false,
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
|
|||||||
@@ -32,12 +32,14 @@ class PermissionOverwrites {
|
|||||||
/**
|
/**
|
||||||
* The permissions that are denied for the user or role as a bitfield.
|
* The permissions that are denied for the user or role as a bitfield.
|
||||||
* @type {number}
|
* @type {number}
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
this.deny = data.deny;
|
this.deny = data.deny;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The permissions that are allowed for the user or role as a bitfield.
|
* The permissions that are allowed for the user or role as a bitfield.
|
||||||
* @type {number}
|
* @type {number}
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
this.allow = data.allow;
|
this.allow = data.allow;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user