diff --git a/src/Discord.Net/Role.cs b/src/Discord.Net/Role.cs
index 4671b22b6..cdf61c5be 100644
--- a/src/Discord.Net/Role.cs
+++ b/src/Discord.Net/Role.cs
@@ -7,43 +7,80 @@ namespace Discord
public sealed class PackedPermissions
{
private uint _rawValue;
- public uint RawValue { get { return _rawValue; } set { _rawValue = value; } }
+ internal uint RawValue { get { return _rawValue; } set { _rawValue = value; } }
- public PackedPermissions() { }
-
+ internal PackedPermissions() { }
+
+ /// If True, a user may create invites.
public bool General_CreateInstantInvite => ((_rawValue >> 0) & 0x1) == 1;
+ /// If True, a user may ban users from the server.
public bool General_BanMembers => ((_rawValue >> 1) & 0x1) == 1;
+ /// If True, a user may kick users from the server.
public bool General_KickMembers => ((_rawValue >> 2) & 0x1) == 1;
+ /// If True, a user adjust roles.
+ /// Having this permission effectively gives all the others as a user may add them to themselves.
public bool General_ManageRoles => ((_rawValue >> 3) & 0x1) == 1;
+ /// If True, a user may create, delete and modify channels.
public bool General_ManageChannels => ((_rawValue >> 4) & 0x1) == 1;
+ /// If True, a user may adjust server properties.
public bool General_ManageServer => ((_rawValue >> 5) & 0x1) == 1;
+
//4 Unused
+
+ /// If True, a user may join channels.
+ /// Note that without this permission, a channel is not sent by the server.
public bool Text_ReadMessages => ((_rawValue >> 10) & 0x1) == 1;
+ /// If True, a user may send messages.
public bool Text_SendMessages => ((_rawValue >> 11) & 0x1) == 1;
+ /// If True, a user may send text-to-speech messages.
public bool Text_SendTTSMessages => ((_rawValue >> 12) & 0x1) == 1;
+ /// If True, a user may delete messages.
public bool Text_ManageMessages => ((_rawValue >> 13) & 0x1) == 1;
+ /// If True, Discord will auto-embed links sent by this user.
public bool Text_EmbedLinks => ((_rawValue >> 14) & 0x1) == 1;
+ /// If True, a user may send files.
public bool Text_AttachFiles => ((_rawValue >> 15) & 0x1) == 1;
+ /// If True, a user may read previous messages.
public bool Text_ReadMessageHistory => ((_rawValue >> 16) & 0x1) == 1;
+ /// If True, a user may mention @everyone.
public bool Text_MentionEveryone => ((_rawValue >> 17) & 0x1) == 1;
+
//2 Unused
+
+ /// If True, a user may connect to a voice channel.
public bool Voice_Connect => ((_rawValue >> 20) & 0x1) == 1;
+ /// If True, a user may speak in a voice channel.
public bool Voice_Speak => ((_rawValue >> 21) & 0x1) == 1;
+ /// If True, a user may mute users.
public bool Voice_MuteMembers => ((_rawValue >> 22) & 0x1) == 1;
+ /// If True, a user may deafen users.
public bool Voice_DeafenMembers => ((_rawValue >> 23) & 0x1) == 1;
+ /// If True, a user may move other users between voice channels.
public bool Voice_MoveMembers => ((_rawValue >> 24) & 0x1) == 1;
+ /// If True, a user may use voice activation rather than push-to-talk.
public bool Voice_UseVoiceActivation => ((_rawValue >> 25) & 0x1) == 1;
+
//6 Unused
+
+ public static implicit operator uint(PackedPermissions perms)
+ {
+ return perms._rawValue;
+ }
}
private readonly DiscordClient _client;
+ /// Returns the unique identifier for this role.
public string Id { get; }
+ /// Returns the name of this role.
public string Name { get; internal set; }
-
+
+ /// Returns the the permissions contained by this role.
public PackedPermissions Permissions { get; }
+ /// Returns the id of the server this role is a member of.
public string ServerId { get; }
+ /// Returns the server this role is a member of.
[JsonIgnore]
public Server Server => _client.GetServer(ServerId);