Throw when attempting to add or remove a member's EveryoneRole (#781)

* Throw when attempting to add or remove a member's EveryoneRole

This resolves #780

* Removed braces
This commit is contained in:
Christopher F
2017-08-17 01:59:58 -04:00
committed by RogueException
parent f997089174
commit 506a6c96c9
2 changed files with 12 additions and 0 deletions

View File

@@ -192,5 +192,13 @@ namespace Discord
throw new ArgumentOutOfRangeException(name, "Messages must be younger than two weeks old.");
}
}
public static void NotEveryoneRole(ulong[] roles, ulong guildId, string name)
{
for (var i = 0; i < roles.Length; i++)
{
if (roles[i] == guildId)
throw new ArgumentException($"The everyone role cannot be assigned to a user", name);
}
}
}
}