| @@ -10056,6 +10056,11 @@ | |||||
| Whether the user has passed the guild's Membership Screening requirements. | Whether the user has passed the guild's Membership Screening requirements. | ||||
| </summary> | </summary> | ||||
| </member> | </member> | ||||
| <member name="P:Discord.IGuildUser.Hierarchy"> | |||||
| <summary> | |||||
| Gets the users position within the role hierarchy. | |||||
| </summary> | |||||
| </member> | |||||
| <member name="M:Discord.IGuildUser.GetPermissions(Discord.IGuildChannel)"> | <member name="M:Discord.IGuildUser.GetPermissions(Discord.IGuildChannel)"> | ||||
| <summary> | <summary> | ||||
| Gets the level permissions granted to this user to a given channel. | Gets the level permissions granted to this user to a given channel. | ||||
| @@ -73,6 +73,11 @@ namespace Discord | |||||
| /// </summary> | /// </summary> | ||||
| bool? IsPending { get; } | bool? IsPending { get; } | ||||
| /// <summary> | |||||
| /// Gets the users position within the role hierarchy. | |||||
| /// </summary> | |||||
| int Hierarchy { get; } | |||||
| /// <summary> | /// <summary> | ||||
| /// Gets the level permissions granted to this user to a given channel. | /// Gets the level permissions granted to this user to a given channel. | ||||
| /// </summary> | /// </summary> | ||||
| @@ -4711,6 +4711,9 @@ | |||||
| <member name="P:Discord.Rest.RestGuildUser.IsPending"> | <member name="P:Discord.Rest.RestGuildUser.IsPending"> | ||||
| <inheritdoc /> | <inheritdoc /> | ||||
| </member> | </member> | ||||
| <member name="P:Discord.Rest.RestGuildUser.Hierarchy"> | |||||
| <inheritdoc /> | |||||
| </member> | |||||
| <member name="P:Discord.Rest.RestGuildUser.GuildPermissions"> | <member name="P:Discord.Rest.RestGuildUser.GuildPermissions"> | ||||
| <inheritdoc /> | <inheritdoc /> | ||||
| <exception cref="T:System.InvalidOperationException" accessor="get">Resolving permissions requires the parent guild to be downloaded.</exception> | <exception cref="T:System.InvalidOperationException" accessor="get">Resolving permissions requires the parent guild to be downloaded.</exception> | ||||
| @@ -4954,6 +4957,9 @@ | |||||
| <member name="P:Discord.Rest.RestWebhookUser.Discord#IGuildUser#IsPending"> | <member name="P:Discord.Rest.RestWebhookUser.Discord#IGuildUser#IsPending"> | ||||
| <inheritdoc /> | <inheritdoc /> | ||||
| </member> | </member> | ||||
| <member name="P:Discord.Rest.RestWebhookUser.Discord#IGuildUser#Hierarchy"> | |||||
| <inheritdoc /> | |||||
| </member> | |||||
| <member name="P:Discord.Rest.RestWebhookUser.Discord#IGuildUser#GuildPermissions"> | <member name="P:Discord.Rest.RestWebhookUser.Discord#IGuildUser#GuildPermissions"> | ||||
| <inheritdoc /> | <inheritdoc /> | ||||
| </member> | </member> | ||||
| @@ -31,6 +31,18 @@ namespace Discord.Rest | |||||
| public ulong GuildId => Guild.Id; | public ulong GuildId => Guild.Id; | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public bool? IsPending { get; private set; } | public bool? IsPending { get; private set; } | ||||
| /// <inheritdoc /> | |||||
| public int Hierarchy | |||||
| { | |||||
| get | |||||
| { | |||||
| if (Guild.OwnerId == Id) | |||||
| return int.MaxValue; | |||||
| var orderedRoles = Guild.Roles.OrderByDescending(x => x.Position); | |||||
| return orderedRoles.Where(x => RoleIds.Contains(x.Id)).Max(x => x.Position); | |||||
| } | |||||
| } | |||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| /// <exception cref="InvalidOperationException" accessor="get">Resolving permissions requires the parent guild to be downloaded.</exception> | /// <exception cref="InvalidOperationException" accessor="get">Resolving permissions requires the parent guild to be downloaded.</exception> | ||||
| @@ -54,6 +54,8 @@ namespace Discord.Rest | |||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| bool? IGuildUser.IsPending => null; | bool? IGuildUser.IsPending => null; | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| int IGuildUser.Hierarchy => 0; | |||||
| /// <inheritdoc /> | |||||
| GuildPermissions IGuildUser.GuildPermissions => GuildPermissions.Webhook; | GuildPermissions IGuildUser.GuildPermissions => GuildPermissions.Webhook; | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||