diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index e26c2f614..eb3817c52 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -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} + * @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 diff --git a/src/structures/TextChannel.js b/src/structures/TextChannel.js index 279a16b5c..7a817d089 100644 --- a/src/structures/TextChannel.js +++ b/src/structures/TextChannel.js @@ -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} - * @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>} diff --git a/src/util/Permissions.js b/src/util/Permissions.js index b6dd20478..679e3c6e1 100644 --- a/src/util/Permissions.js +++ b/src/util/Permissions.js @@ -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,