* 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:
committed by
Christopher F
parent
804d9188e7
commit
edfbd055bb
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user