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:
committed by
RogueException
parent
f997089174
commit
506a6c96c9
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user