diff --git a/src/Discord.Net.Core/Entities/Permissions/ChannelPermission.cs b/src/Discord.Net.Core/Entities/Permissions/ChannelPermission.cs
index 3e438f43f..740b6c30b 100644
--- a/src/Discord.Net.Core/Entities/Permissions/ChannelPermission.cs
+++ b/src/Discord.Net.Core/Entities/Permissions/ChannelPermission.cs
@@ -11,7 +11,9 @@ namespace Discord
// Text
AddReactions = 0x00_00_00_40,
- ReadMessages = 0x00_00_04_00,
+ [Obsolete("Use ViewChannel instead.")]
+ ReadMessages = ViewChannel,
+ ViewChannel = 0x00_00_04_00,
SendMessages = 0x00_00_08_00,
SendTTSMessages = 0x00_00_10_00,
ManageMessages = 0x00_00_20_00,
diff --git a/src/Discord.Net.Core/Entities/Permissions/ChannelPermissions.cs b/src/Discord.Net.Core/Entities/Permissions/ChannelPermissions.cs
index 4c11d0db0..1b32abf9f 100644
--- a/src/Discord.Net.Core/Entities/Permissions/ChannelPermissions.cs
+++ b/src/Discord.Net.Core/Entities/Permissions/ChannelPermissions.cs
@@ -41,7 +41,11 @@ namespace Discord
/// If true, a user may add reactions.
public bool AddReactions => Permissions.GetValue(RawValue, ChannelPermission.AddReactions);
/// If True, a user may join channels.
- public bool ReadMessages => Permissions.GetValue(RawValue, ChannelPermission.ReadMessages);
+ [Obsolete("Use ViewChannel instead.")]
+ public bool ReadMessages => ViewChannel;
+ /// If True, a user may view channels.
+ public bool ViewChannel => Permissions.GetValue(RawValue, ChannelPermission.ViewChannel);
+
/// If True, a user may send messages.
public bool SendMessages => Permissions.GetValue(RawValue, ChannelPermission.SendMessages);
/// If True, a user may send text-to-speech messages.
@@ -82,7 +86,7 @@ namespace Discord
private ChannelPermissions(ulong initialValue, bool? createInstantInvite = null, bool? manageChannel = null,
bool? addReactions = null,
- bool? readMessages = null, bool? sendMessages = null, bool? sendTTSMessages = null, bool? manageMessages = null,
+ bool? viewChannel = null, bool? sendMessages = null, bool? sendTTSMessages = null, bool? manageMessages = null,
bool? embedLinks = null, bool? attachFiles = null, bool? readMessageHistory = null, bool? mentionEveryone = null,
bool? useExternalEmojis = null, bool? connect = null, bool? speak = null, bool? muteMembers = null, bool? deafenMembers = null,
bool? moveMembers = null, bool? useVoiceActivation = null, bool? manageRoles = null, bool? manageWebhooks = null)
@@ -92,7 +96,7 @@ namespace Discord
Permissions.SetValue(ref value, createInstantInvite, ChannelPermission.CreateInstantInvite);
Permissions.SetValue(ref value, manageChannel, ChannelPermission.ManageChannels);
Permissions.SetValue(ref value, addReactions, ChannelPermission.AddReactions);
- Permissions.SetValue(ref value, readMessages, ChannelPermission.ReadMessages);
+ Permissions.SetValue(ref value, viewChannel, ChannelPermission.ViewChannel);
Permissions.SetValue(ref value, sendMessages, ChannelPermission.SendMessages);
Permissions.SetValue(ref value, sendTTSMessages, ChannelPermission.SendTTSMessages);
Permissions.SetValue(ref value, manageMessages, ChannelPermission.ManageMessages);
diff --git a/src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs b/src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs
index c3e296e2c..108b67273 100644
--- a/src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs
+++ b/src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using System.Diagnostics;
namespace Discord
@@ -27,7 +28,10 @@ namespace Discord
/// If Allowed, a user may add reactions.
public PermValue AddReactions => Permissions.GetValue(AllowValue, DenyValue, ChannelPermission.AddReactions);
/// If Allowed, a user may join channels.
- public PermValue ReadMessages => Permissions.GetValue(AllowValue, DenyValue, ChannelPermission.ReadMessages);
+ [Obsolete("Use ViewChannel instead.")]
+ public PermValue ReadMessages => ViewChannel;
+ /// If Allowed, a user may join channels.
+ public PermValue ViewChannel => Permissions.GetValue(AllowValue, DenyValue, ChannelPermission.ViewChannel);
/// If Allowed, a user may send messages.
public PermValue SendMessages => Permissions.GetValue(AllowValue, DenyValue, ChannelPermission.SendMessages);
/// If Allowed, a user may send text-to-speech messages.
@@ -72,7 +76,7 @@ namespace Discord
private OverwritePermissions(ulong allowValue, ulong denyValue, PermValue? createInstantInvite = null, PermValue? manageChannel = null,
PermValue? addReactions = null,
- PermValue? readMessages = null, PermValue? sendMessages = null, PermValue? sendTTSMessages = null, PermValue? manageMessages = null,
+ PermValue? viewChannel = null, PermValue? sendMessages = null, PermValue? sendTTSMessages = null, PermValue? manageMessages = null,
PermValue? embedLinks = null, PermValue? attachFiles = null, PermValue? readMessageHistory = null, PermValue? mentionEveryone = null,
PermValue? useExternalEmojis = null, PermValue? connect = null, PermValue? speak = null, PermValue? muteMembers = null,
PermValue? deafenMembers = null, PermValue? moveMembers = null, PermValue? useVoiceActivation = null, PermValue? manageRoles = null,
@@ -81,7 +85,7 @@ namespace Discord
Permissions.SetValue(ref allowValue, ref denyValue, createInstantInvite, ChannelPermission.CreateInstantInvite);
Permissions.SetValue(ref allowValue, ref denyValue, manageChannel, ChannelPermission.ManageChannels);
Permissions.SetValue(ref allowValue, ref denyValue, addReactions, ChannelPermission.AddReactions);
- Permissions.SetValue(ref allowValue, ref denyValue, readMessages, ChannelPermission.ReadMessages);
+ Permissions.SetValue(ref allowValue, ref denyValue, viewChannel, ChannelPermission.ViewChannel);
Permissions.SetValue(ref allowValue, ref denyValue, sendMessages, ChannelPermission.SendMessages);
Permissions.SetValue(ref allowValue, ref denyValue, sendTTSMessages, ChannelPermission.SendTTSMessages);
Permissions.SetValue(ref allowValue, ref denyValue, manageMessages, ChannelPermission.ManageMessages);
diff --git a/src/Discord.Net.Core/Utils/Permissions.cs b/src/Discord.Net.Core/Utils/Permissions.cs
index a7de90623..367926dd1 100644
--- a/src/Discord.Net.Core/Utils/Permissions.cs
+++ b/src/Discord.Net.Core/Utils/Permissions.cs
@@ -152,7 +152,7 @@ namespace Discord
if (channel is ITextChannel textChannel)
{
- if (!GetValue(resolvedPermissions, ChannelPermission.ReadMessages))
+ if (!GetValue(resolvedPermissions, ChannelPermission.ViewChannel))
{
//No read permission on a text channel removes all other permissions
resolvedPermissions = 0;
diff --git a/src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs b/src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs
index 8dcb8c284..29d1d529f 100644
--- a/src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs
+++ b/src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs
@@ -234,7 +234,7 @@ namespace Discord.Rest
if (model == null)
return null;
var user = RestGuildUser.Create(client, guild, model);
- if (!user.GetPermissions(channel).ReadMessages)
+ if (!user.GetPermissions(channel).ViewChannel)
return null;
return user;
@@ -255,7 +255,7 @@ namespace Discord.Rest
var models = await client.ApiClient.GetGuildMembersAsync(guild.Id, args, options).ConfigureAwait(false);
return models
.Select(x => RestGuildUser.Create(client, guild, x))
- .Where(x => x.GetPermissions(channel).ReadMessages)
+ .Where(x => x.GetPermissions(channel).ViewChannel)
.ToImmutableArray();
},
nextPage: (info, lastPage) =>
diff --git a/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs b/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs
index de4b89e39..d3f020bf9 100644
--- a/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs
+++ b/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs
@@ -192,7 +192,7 @@ namespace Discord.Rest
var channels = await GetTextChannelsAsync(options).ConfigureAwait(false);
var user = await GetCurrentUserAsync(options).ConfigureAwait(false);
return channels
- .Where(c => user.GetPermissions(c).ReadMessages)
+ .Where(c => user.GetPermissions(c).ViewChannel)
.OrderBy(c => c.Position)
.FirstOrDefault();
}
diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketTextChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketTextChannel.cs
index 07ec630d3..405d72d9e 100644
--- a/src/Discord.Net.WebSocket/Entities/Channels/SocketTextChannel.cs
+++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketTextChannel.cs
@@ -25,7 +25,7 @@ namespace Discord.WebSocket
public override IReadOnlyCollection Users
=> Guild.Users.Where(x => Permissions.GetValue(
Permissions.ResolveChannel(Guild, x, this, Permissions.ResolveGuild(Guild, x)),
- ChannelPermission.ReadMessages)).ToImmutableArray();
+ ChannelPermission.ViewChannel)).ToImmutableArray();
internal SocketTextChannel(DiscordSocketClient discord, ulong id, SocketGuild guild)
: base(discord, id, guild)
@@ -107,7 +107,7 @@ namespace Discord.WebSocket
{
var guildPerms = Permissions.ResolveGuild(Guild, user);
var channelPerms = Permissions.ResolveChannel(Guild, user, this, guildPerms);
- if (Permissions.GetValue(channelPerms, ChannelPermission.ReadMessages))
+ if (Permissions.GetValue(channelPerms, ChannelPermission.ViewChannel))
return user;
}
return null;