Fix #854 Added ViewChannel enum and property to channel permissions (#874)

* Fix #854 Added ViewChannel enum and property to channel permissions

* replaced usages of ChannelPermission#ReadMessages with ViewChannel

* rename parameter of ChannelPermissions constructor

* made OverwritePermissions#ReadMessages obsolete, use ViewChannel instead

* Fix #854 Added ViewChannel enum and property to channel permissions

replaced usages of ChannelPermission#ReadMessages with ViewChannel

rename parameter of ChannelPermissions constructor

made OverwritePermissions#ReadMessages obsolete, use ViewChannel instead

* renamed readMessages parameter in ChannelPermissions constructor and Modify

* fixed channel permission tests to use ChannelPermission enum instead of GuildPermission enum

* replaced usages of readmessages in channel permission tests

* resolve build warnings for permission tests
This commit is contained in:
Chris Johnston
2018-01-06 19:35:17 -08:00
committed by Christopher F
parent 804d9188e7
commit edfbd055bb
9 changed files with 67 additions and 51 deletions

View File

@@ -197,7 +197,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();
}