mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
permissions rename :3 (#1788)
* permissions rename :3 * Update Permissions.js * Update TextChannel.js * Update GuildChannel.js
This commit is contained in:
@@ -195,6 +195,21 @@ class GuildChannel extends Channel {
|
||||
.then(() => this);
|
||||
}
|
||||
|
||||
/**
|
||||
* A collection of members that can see this channel, mapped by their ID
|
||||
* @type {Collection<Snowflake, GuildMember>}
|
||||
* @readonly
|
||||
*/
|
||||
get members() {
|
||||
const members = new Collection();
|
||||
for (const member of this.guild.members.values()) {
|
||||
if (this.permissionsFor(member).has('VIEW_CHANNEL')) {
|
||||
members.set(member.id, member);
|
||||
}
|
||||
}
|
||||
return members;
|
||||
}
|
||||
|
||||
/**
|
||||
* The data for a guild channel.
|
||||
* @typedef {Object} ChannelData
|
||||
|
||||
@@ -35,21 +35,6 @@ class TextChannel extends GuildChannel {
|
||||
this.lastMessageID = data.last_message_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* A collection of members that can see this channel, mapped by their ID
|
||||
* @type {Collection<Snowflake, GuildMember>}
|
||||
* @readonly
|
||||
*/
|
||||
get members() {
|
||||
const members = new Collection();
|
||||
for (const member of this.guild.members.values()) {
|
||||
if (this.permissionsFor(member).has('READ_MESSAGES')) {
|
||||
members.set(member.id, member);
|
||||
}
|
||||
}
|
||||
return members;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch all webhooks for the channel.
|
||||
* @returns {Promise<Collection<Snowflake, Webhook>>}
|
||||
|
||||
@@ -110,7 +110,7 @@ class Permissions {
|
||||
* - `MANAGE_GUILD` (edit the guild information, region, etc.)
|
||||
* - `ADD_REACTIONS` (add new reactions to messages)
|
||||
* - `VIEW_AUDIT_LOG`
|
||||
* - `READ_MESSAGES`
|
||||
* - `VIEW_CHANNELS`
|
||||
* - `SEND_MESSAGES`
|
||||
* - `SEND_TTS_MESSAGES`
|
||||
* - `MANAGE_MESSAGES` (delete messages and reactions)
|
||||
@@ -143,7 +143,7 @@ Permissions.FLAGS = {
|
||||
ADD_REACTIONS: 1 << 6,
|
||||
VIEW_AUDIT_LOG: 1 << 7,
|
||||
|
||||
READ_MESSAGES: 1 << 10,
|
||||
VIEW_CHANNEL: 1 << 10,
|
||||
SEND_MESSAGES: 1 << 11,
|
||||
SEND_TTS_MESSAGES: 1 << 12,
|
||||
MANAGE_MESSAGES: 1 << 13,
|
||||
|
||||
Reference in New Issue
Block a user