Skip to content

Commit

Permalink
Deprecates ReadMessages, introduces ViewChannel (discord-net#1033)
Browse files Browse the repository at this point in the history
* Deprecates ReadMessages, introduces ViewChannel

* Adds period and comma somehow missed
  • Loading branch information
HelpfulStranger999 authored and foxbot committed May 25, 2018
1 parent bc6009e commit 5f084ad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/Discord.Net.Core/Entities/Permissions/GuildPermission.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;

namespace Discord
{
Expand All @@ -16,7 +16,9 @@ public enum GuildPermission : ulong
// Text
AddReactions = 0x00_00_00_40,
ViewAuditLog = 0x00_00_00_80,
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,
Expand Down
8 changes: 6 additions & 2 deletions src/Discord.Net.Core/Entities/Permissions/GuildPermissions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Diagnostics;

namespace Discord
Expand Down Expand Up @@ -35,7 +36,10 @@ public struct GuildPermissions
public bool ViewAuditLog => Permissions.GetValue(RawValue, GuildPermission.ViewAuditLog);

/// <summary> If True, a user may join channels. </summary>
public bool ReadMessages => Permissions.GetValue(RawValue, GuildPermission.ReadMessages);
[Obsolete("Use ViewChannel instead.")]
public bool ReadMessages => ViewChannel;
/// <summary> If True, a user may view channels. </summary>
public bool ViewChannel => Permissions.GetValue(RawValue, GuildPermission.ViewChannel);
/// <summary> If True, a user may send messages. </summary>
public bool SendMessages => Permissions.GetValue(RawValue, GuildPermission.SendMessages);
/// <summary> If True, a user may send text-to-speech messages. </summary>
Expand Down

0 comments on commit 5f084ad

Please sign in to comment.