Browse Source

Fixed several permission bugs

pull/58/head
Voltana 9 years ago
parent
commit
a87027b7ab
2 changed files with 5 additions and 5 deletions
  1. +4
    -4
      src/Discord.Net/Models/Permissions.cs
  2. +1
    -1
      src/Discord.Net/Models/Server.cs

+ 4
- 4
src/Discord.Net/Models/Permissions.cs View File

@@ -54,14 +54,14 @@ namespace Discord
public bool UseVoiceActivation => PermissionsHelper.GetValue(RawValue, PermissionBits.UseVoiceActivation);

/// <summary> If True, a user may change their own nickname. </summary>
public bool ChangeNickname => PermissionsHelper.GetValue(RawValue, PermissionBits.ManageRolesOrPermissions);
public bool ChangeNickname => PermissionsHelper.GetValue(RawValue, PermissionBits.ChangeNickname);
/// <summary> If True, a user may change the nickname of other users. </summary>
public bool ManageNicknames => PermissionsHelper.GetValue(RawValue, PermissionBits.ManageRolesOrPermissions);
public bool ManageNicknames => PermissionsHelper.GetValue(RawValue, PermissionBits.ManageNicknames);
/// <summary> If True, a user may adjust roles. </summary>
public bool ManageRoles => PermissionsHelper.GetValue(RawValue, PermissionBits.ManageRolesOrPermissions);

public ServerPermissions(bool? createInstantInvite = null, bool? administrator = null,
bool? kickMembers = null, bool? banMembers = null, bool? manageChannel = null, bool? manageServer = null,
bool? banMembers = null, bool? kickMembers = null, bool? manageChannel = null, bool? manageServer = null,
bool? readMessages = null, bool? sendMessages = null, bool? sendTTSMessages = null, bool? manageMessages = null,
bool? embedLinks = null, bool? attachFiles = null, bool? readMessageHistory = null, bool? mentionEveryone = null,
bool? connect = null, bool? speak = null, bool? muteMembers = null, bool? deafenMembers = null,
@@ -72,7 +72,7 @@ namespace Discord
{
}
public ServerPermissions(ServerPermissions basePerms, bool? createInstantInvite = null, bool? administrator = null,
bool? kickMembers = null, bool? banMembers = null, bool? manageChannel = null, bool? manageServer = null,
bool? banMembers = null, bool? kickMembers = null, bool? manageChannel = null, bool? manageServer = null,
bool? readMessages = null, bool? sendMessages = null, bool? sendTTSMessages = null, bool? manageMessages = null,
bool? embedLinks = null, bool? attachFiles = null, bool? readMessageHistory = null, bool? mentionEveryone = null,
bool? connect = null, bool? speak = null, bool? muteMembers = null, bool? deafenMembers = null,


+ 1
- 1
src/Discord.Net/Models/Server.cs View File

@@ -439,7 +439,7 @@ namespace Discord
newPermissions |= serverRole.Permissions.RawValue;
}

if (newPermissions.HasBit((byte)PermissionBits.ManageRolesOrPermissions))
if (newPermissions.HasBit((byte)PermissionBits.Administrator))
newPermissions = ServerPermissions.All.RawValue;

if (newPermissions != permissions.RawValue)


Loading…
Cancel
Save