| @@ -13,7 +13,7 @@ namespace Discord | |||||
| /// <inheritdoc/> | /// <inheritdoc/> | ||||
| public ActivityType Type { get; internal set; } | public ActivityType Type { get; internal set; } | ||||
| /// <inheritdoc/> | /// <inheritdoc/> | ||||
| public int Flags { get; internal set; } | |||||
| public ActivityFlag Flags { get; internal set; } | |||||
| internal Game() { } | internal Game() { } | ||||
| /// <summary> | /// <summary> | ||||
| @@ -24,11 +24,10 @@ namespace Discord | |||||
| /// </summary> | /// </summary> | ||||
| /// <remarks> | /// <remarks> | ||||
| /// This value is determined by bitwise OR-ing <see cref="ActivityFlag"/> values together. | /// This value is determined by bitwise OR-ing <see cref="ActivityFlag"/> values together. | ||||
| /// Each flag's value can be checked using <see cref="ActivityExtensions.CheckActivityFlag(IActivity, ActivityFlag)"/> | |||||
| /// </remarks> | /// </remarks> | ||||
| /// <returns> | /// <returns> | ||||
| /// The value of flags for this activity. | /// The value of flags for this activity. | ||||
| /// </returns> | /// </returns> | ||||
| int Flags { get; } | |||||
| ActivityFlag Flags { get; } | |||||
| } | } | ||||
| } | } | ||||
| @@ -117,12 +117,11 @@ namespace Discord | |||||
| /// </summary> | /// </summary> | ||||
| /// <remarks> | /// <remarks> | ||||
| /// This value is determined by bitwise OR-ing <see cref="UserFlag"/> values together. | /// This value is determined by bitwise OR-ing <see cref="UserFlag"/> values together. | ||||
| /// Each flag's value can be checked using <see cref="UserExtensions.CheckUserFlag(IUser, UserFlag)"/> | |||||
| /// </remarks> | /// </remarks> | ||||
| /// <returns> | /// <returns> | ||||
| /// The value of flags for this user. | /// The value of flags for this user. | ||||
| /// </returns> | /// </returns> | ||||
| int Flags { get; } | |||||
| UserFlag Flags { get; } | |||||
| /// <summary> | /// <summary> | ||||
| /// The type of Nitro subscription that is active on this user's account. | /// The type of Nitro subscription that is active on this user's account. | ||||
| /// </summary> | /// </summary> | ||||
| @@ -1,19 +0,0 @@ | |||||
| namespace Discord | |||||
| { | |||||
| /// <summary> | |||||
| /// Extension methods for the <see cref="IActivity"/> types. | |||||
| /// </summary> | |||||
| public static class ActivityExtensions | |||||
| { | |||||
| /// <summary> | |||||
| /// Determines if the given flag is enabled with this activity. | |||||
| /// </summary> | |||||
| /// <param name="user">The user to check.</param> | |||||
| /// <param name="flag">The <see cref="ActivityFlag"/> to check for.</param> | |||||
| /// <returns> | |||||
| /// True if the activity has this flag enabled, false otherwise. | |||||
| /// </returns> | |||||
| public static bool CheckActivityFlag(this IActivity activity, ActivityFlag flag) | |||||
| => (activity.Flags & (int)flag) >= (int)flag; | |||||
| } | |||||
| } | |||||
| @@ -160,16 +160,5 @@ namespace Discord | |||||
| /// </returns> | /// </returns> | ||||
| public static Task BanAsync(this IGuildUser user, int pruneDays = 0, string reason = null, RequestOptions options = null) | public static Task BanAsync(this IGuildUser user, int pruneDays = 0, string reason = null, RequestOptions options = null) | ||||
| => user.Guild.AddBanAsync(user, pruneDays, reason, options); | => user.Guild.AddBanAsync(user, pruneDays, reason, options); | ||||
| /// <summary> | |||||
| /// Determines if the user has a given flag applied to their account. | |||||
| /// </summary> | |||||
| /// <param name="user">The user to check.</param> | |||||
| /// <param name="flag">The <see cref="UserFlag"/> to check for.</param> | |||||
| /// <returns> | |||||
| /// True if the user has the given flag on their account, otherwise false. | |||||
| /// </returns> | |||||
| public static bool CheckUserFlag(this IUser user, UserFlag flag) | |||||
| => (user.Flags & (int)flag) >= (int)flag; | |||||
| } | } | ||||
| } | } | ||||
| @@ -34,7 +34,7 @@ namespace Discord.API | |||||
| [JsonProperty("session_id")] | [JsonProperty("session_id")] | ||||
| public Optional<string> SessionId { get; set; } | public Optional<string> SessionId { get; set; } | ||||
| [JsonProperty("Flags")] | [JsonProperty("Flags")] | ||||
| public Optional<int> Flags { get; set; } | |||||
| public Optional<ActivityFlag> Flags { get; set; } | |||||
| [OnError] | [OnError] | ||||
| internal void OnError(StreamingContext context, ErrorContext errorContext) | internal void OnError(StreamingContext context, ErrorContext errorContext) | ||||
| @@ -24,7 +24,7 @@ namespace Discord.API | |||||
| [JsonProperty("mfa_enabled")] | [JsonProperty("mfa_enabled")] | ||||
| public Optional<bool> MfaEnabled { get; set; } | public Optional<bool> MfaEnabled { get; set; } | ||||
| [JsonProperty("flags")] | [JsonProperty("flags")] | ||||
| public Optional<int> Flags { get; set; } | |||||
| public Optional<UserFlag> Flags { get; set; } | |||||
| [JsonProperty("premium_type")] | [JsonProperty("premium_type")] | ||||
| public Optional<PremiumType> PremiumType { get; set; } | public Optional<PremiumType> PremiumType { get; set; } | ||||
| [JsonProperty("locale")] | [JsonProperty("locale")] | ||||
| @@ -33,7 +33,7 @@ namespace Discord.Rest | |||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public virtual bool IsWebhook => false; | public virtual bool IsWebhook => false; | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public int Flags { get; private set; } | |||||
| public UserFlag Flags { get; private set; } | |||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public PremiumType? PremiumType { get; private set; } | public PremiumType? PremiumType { get; private set; } | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| @@ -39,7 +39,7 @@ namespace Discord.WebSocket | |||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public UserStatus Status => Presence.Status; | public UserStatus Status => Presence.Status; | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public int Flags { get; internal set; } | |||||
| public UserFlag Flags { get; internal set; } | |||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public PremiumType? PremiumType { get; internal set; } | public PremiumType? PremiumType { get; internal set; } | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||