diff --git a/src/Discord.Net.Core/Entities/Users/IUser.cs b/src/Discord.Net.Core/Entities/Users/IUser.cs
index c36fb2326..e6008aab6 100644
--- a/src/Discord.Net.Core/Entities/Users/IUser.cs
+++ b/src/Discord.Net.Core/Entities/Users/IUser.cs
@@ -75,6 +75,16 @@ namespace Discord
/// Gets the username for this user.
///
string Username { get; }
+ ///
+ /// Gets the public flags that are applied to this user's account.
+ ///
+ ///
+ /// This value is determined by bitwise OR-ing values together.
+ ///
+ ///
+ /// The value of public flags for this user.
+ ///
+ UserProperties? PublicFlags { get; }
///
/// Gets the direct message channel of this user, or create one if it does not already exist.
diff --git a/src/Discord.Net.Core/Entities/Users/UserProperties.cs b/src/Discord.Net.Core/Entities/Users/UserProperties.cs
index 4f7272daa..b6deb744b 100644
--- a/src/Discord.Net.Core/Entities/Users/UserProperties.cs
+++ b/src/Discord.Net.Core/Entities/Users/UserProperties.cs
@@ -10,32 +10,62 @@ namespace Discord
///
None = 0,
///
- /// Flag given to Discord staff.
+ /// Flag given to users who are a Discord employee.
///
- Staff = 0b1,
+ Staff = 1 << 0,
///
- /// Flag given to Discord partners.
+ /// Flag given to users who are owners of a partnered Discord server.
///
- Partner = 0b10,
+ Partner = 1 << 1,
+ ///
+ /// Flag given to users in HypeSquad events.
+ ///
+ HypeSquadEvents = 1 << 2,
///
/// Flag given to users who have participated in the bug report program.
+ /// This flag is obsolete, use instead.
+ ///
+ [Obsolete("Use BugHunterLevel1 instead.")]
+ BugHunter = 1 << 3,
+ ///
+ /// Flag given to users who have participated in the bug report program and are level 1.
///
- BugHunter = 0b1000,
+ BugHunterLevel1 = 1 << 3,
///
/// Flag given to users who are in the HypeSquad House of Bravery.
///
- HypeSquadBravery = 0b100_0000,
+ HypeSquadBravery = 1 << 6,
///
/// Flag given to users who are in the HypeSquad House of Brilliance.
///
- HypeSquadBrilliance = 0b1000_0000,
+ HypeSquadBrilliance = 1 << 7,
///
/// Flag given to users who are in the HypeSquad House of Balance.
///
- HypeSquadBalance = 0b1_0000_0000,
+ HypeSquadBalance = 1 << 8,
///
/// Flag given to users who subscribed to Nitro before games were added.
///
- EarlySupporter = 0b10_0000_0000,
+ EarlySupporter = 1 << 9,
+ ///
+ /// Flag given to users who are part of a team.
+ ///
+ TeamUser = 1 << 10,
+ ///
+ /// Flag given to users who represent Discord (System).
+ ///
+ System = 1 << 12,
+ ///
+ /// Flag given to users who have participated in the bug report program and are level 2.
+ ///
+ BugHunterLevel2 = 1 << 14,
+ ///
+ /// Flag given to users who are verified bots.
+ ///
+ VerifiedBot = 1 << 16,
+ ///
+ /// Flag given to users that developed bots and early verified their accounts.
+ ///
+ EarlyVerifiedBotDeveloper = 1 << 17,
}
}
diff --git a/src/Discord.Net.Rest/API/Common/User.cs b/src/Discord.Net.Rest/API/Common/User.cs
index 2eff3753d..d1f436afb 100644
--- a/src/Discord.Net.Rest/API/Common/User.cs
+++ b/src/Discord.Net.Rest/API/Common/User.cs
@@ -29,5 +29,7 @@ namespace Discord.API
public Optional PremiumType { get; set; }
[JsonProperty("locale")]
public Optional Locale { get; set; }
+ [JsonProperty("public_flags")]
+ public Optional PublicFlags { get; set; }
}
}
diff --git a/src/Discord.Net.Rest/Entities/Users/RestUser.cs b/src/Discord.Net.Rest/Entities/Users/RestUser.cs
index f5becd3ff..131a4ec73 100644
--- a/src/Discord.Net.Rest/Entities/Users/RestUser.cs
+++ b/src/Discord.Net.Rest/Entities/Users/RestUser.cs
@@ -21,6 +21,8 @@ namespace Discord.Rest
public ushort DiscriminatorValue { get; private set; }
///
public string AvatarId { get; private set; }
+ ///
+ public UserProperties? PublicFlags { get; private set; }
///
public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id);
@@ -65,6 +67,8 @@ namespace Discord.Rest
IsBot = model.Bot.Value;
if (model.Username.IsSpecified)
Username = model.Username.Value;
+ if (model.PublicFlags.IsSpecified)
+ PublicFlags = model.PublicFlags.Value;
}
///
diff --git a/src/Discord.Net.WebSocket/Entities/Users/SocketUser.cs b/src/Discord.Net.WebSocket/Entities/Users/SocketUser.cs
index 7d3c2d23b..4e6d4b3f8 100644
--- a/src/Discord.Net.WebSocket/Entities/Users/SocketUser.cs
+++ b/src/Discord.Net.WebSocket/Entities/Users/SocketUser.cs
@@ -26,6 +26,8 @@ namespace Discord.WebSocket
public abstract string AvatarId { get; internal set; }
///
public abstract bool IsWebhook { get; }
+ ///
+ public UserProperties? PublicFlags { get; private set; }
internal abstract SocketGlobalUser GlobalUser { get; }
internal abstract SocketPresence Presence { get; set; }
@@ -83,6 +85,11 @@ namespace Discord.WebSocket
Username = model.Username.Value;
hasChanges = true;
}
+ if (model.PublicFlags.IsSpecified && model.PublicFlags.Value != PublicFlags)
+ {
+ PublicFlags = model.PublicFlags.Value;
+ hasChanges = true;
+ }
return hasChanges;
}