[Feature] Add support for Guild Member Flags (#2571)

* implement `GuildUserFlags`

Co-authored-by: Casmir <68127614+csmir@users.noreply.github.com>
This commit is contained in:
Misha133
2023-01-23 21:44:34 +03:00
committed by GitHub
parent 94996e7331
commit 7d8d6ec1a6
11 changed files with 80 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
namespace Discord;
/// <summary>
/// Represents public flags for a guild member.
/// </summary>
public enum GuildUserFlags
{
/// <summary>
/// Member has no flags set.
/// </summary>
None = 0,
/// <summary>
/// Member has left and rejoined the guild.
/// </summary>
/// <remarks>
/// Cannot be modified.
/// </remarks>
DidRejoin = 1 << 0,
/// <summary>
/// Member has completed onboarding.
/// </summary>
/// <remarks>
/// Cannot be modified.
/// </remarks>
CompletedOnboarding = 1 << 1,
/// <summary>
/// Member bypasses guild verification requirements.
/// </summary>
BypassesVerification = 1 << 2,
/// <summary>
/// Member has started onboarding.
/// </summary>
/// <remarks>
/// Cannot be modified.
/// </remarks>
StartedOnboarding = 1 << 3,
}

View File

@@ -82,5 +82,13 @@ namespace Discord
/// <see langword="null"/> or a time in the past to clear a currently existing timeout.
/// </remarks>
public Optional<DateTimeOffset?> TimedOutUntil { get; set; }
/// <summary>
/// Gets or sets the flags of the guild member.
/// </summary>
/// <remarks>
/// Not all flags can be modified, these are reserved for Discord.
/// </remarks>
public Optional<GuildUserFlags> Flags { get; set; }
}
}

View File

@@ -111,6 +111,11 @@ namespace Discord
/// </returns>
DateTimeOffset? TimedOutUntil { get; }
/// <summary>
/// Gets the public flags for this guild member.
/// </summary>
GuildUserFlags Flags { get; }
/// <summary>
/// Gets the level permissions granted to this user to a given channel.
/// </summary>