@@ -10,7 +10,7 @@ | |||||
<meta property="og:locale" content="en-us"> | <meta property="og:locale" content="en-us"> | ||||
<meta property="og:type" content="website"> | <meta property="og:type" content="website"> | ||||
<meta property="og:site_name" content="Discord.Net Docs"> | <meta property="og:site_name" content="Discord.Net Docs"> | ||||
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/discord-net/Discord.Net/docs/marketing/logo/PackageLogo.png"> | |||||
<meta property="og:image" content="https://raw.githubusercontent.com/Discord-Net-Labs/Discord.Net-Labs/release/3.x/docs/marketing/logo/PackageLogo.png"> | |||||
<meta property="og:image:alt" content="Discord.Net Logo"> | <meta property="og:image:alt" content="Discord.Net Logo"> | ||||
<meta name="theme-color" content="#995EA7"/> | <meta name="theme-color" content="#995EA7"/> | ||||
<meta name="generator" content="docfx {{_docfxVersion}}"> | <meta name="generator" content="docfx {{_docfxVersion}}"> | ||||
@@ -108,5 +108,9 @@ namespace Discord | |||||
/// the value of <see cref="PreferredCulture"/> will be unused. | /// the value of <see cref="PreferredCulture"/> will be unused. | ||||
/// </remarks> | /// </remarks> | ||||
public Optional<CultureInfo> PreferredCulture { get; set; } | public Optional<CultureInfo> PreferredCulture { get; set; } | ||||
/// <summary> | |||||
/// Gets or sets if the boost progress bar is enabled. | |||||
/// </summary> | |||||
public Optional<bool> IsBoostProgressBarEnabled { get; set; } | |||||
} | } | ||||
} | } |
@@ -339,6 +339,13 @@ namespace Discord | |||||
/// The preferred culture information of this guild. | /// The preferred culture information of this guild. | ||||
/// </returns> | /// </returns> | ||||
CultureInfo PreferredCulture { get; } | CultureInfo PreferredCulture { get; } | ||||
/// <summary> | |||||
/// Gets whether the guild has the boost progress bar enabled. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// <see langword="true"/> if the boost progress bar is enabled; otherwise <see langword="false"/>. | |||||
/// </returns> | |||||
bool IsBoostProgressBarEnabled { get; } | |||||
/// <summary> | /// <summary> | ||||
/// Modifies this guild. | /// Modifies this guild. | ||||
@@ -10,18 +10,7 @@ namespace Discord | |||||
/// <summary> | /// <summary> | ||||
/// Gets the identifier of this user's avatar. | /// Gets the identifier of this user's avatar. | ||||
/// </summary> | /// </summary> | ||||
string AvatarId { get; } | |||||
/// <summary> | |||||
/// Gets the identifier of this user's banner. | |||||
/// </summary> | |||||
string BannerId { get; } | |||||
/// <summary> | |||||
/// Gets the user's banner color. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A <see cref="Color"/> struct representing the accent color of this user's banner. | |||||
/// </returns> | |||||
Color? AccentColor { get; } | |||||
string AvatarId { get; } | |||||
/// <summary> | /// <summary> | ||||
/// Gets the avatar URL for this user. | /// Gets the avatar URL for this user. | ||||
/// </summary> | /// </summary> | ||||
@@ -46,16 +35,6 @@ namespace Discord | |||||
/// </returns> | /// </returns> | ||||
string GetAvatarUrl(ImageFormat format = ImageFormat.Auto, ushort size = 128); | string GetAvatarUrl(ImageFormat format = ImageFormat.Auto, ushort size = 128); | ||||
/// <summary> | /// <summary> | ||||
/// Gets the banner URL for this user. | |||||
/// </summary> | |||||
/// <param name="format">The format to return.</param> | |||||
/// <param name="size">The size of the image to return in. This can be any power of two between 16 and 2048. | |||||
/// </param> | |||||
/// <returns> | |||||
/// A string representing the user's avatar URL; <c>null</c> if the user does not have an banner in place. | |||||
/// </returns> | |||||
string GetBannerUrl(ImageFormat format = ImageFormat.Auto, ushort size = 256); | |||||
/// <summary> | |||||
/// Gets the default avatar URL for this user. | /// Gets the default avatar URL for this user. | ||||
/// </summary> | /// </summary> | ||||
/// <remarks> | /// <remarks> | ||||
@@ -81,5 +81,7 @@ namespace Discord.API | |||||
public NsfwLevel NsfwLevel { get; set; } | public NsfwLevel NsfwLevel { get; set; } | ||||
[JsonProperty("stickers")] | [JsonProperty("stickers")] | ||||
public Sticker[] Stickers { get; set; } | public Sticker[] Stickers { get; set; } | ||||
[JsonProperty("premium_progress_bar_enabled")] | |||||
public Optional<bool> IsBoostProgressBarEnabled { get; set; } | |||||
} | } | ||||
} | } |
@@ -35,5 +35,7 @@ namespace Discord.API.Rest | |||||
public Optional<SystemChannelMessageDeny> SystemChannelFlags { get; set; } | public Optional<SystemChannelMessageDeny> SystemChannelFlags { get; set; } | ||||
[JsonProperty("preferred_locale")] | [JsonProperty("preferred_locale")] | ||||
public string PreferredLocale { get; set; } | public string PreferredLocale { get; set; } | ||||
[JsonProperty("premium_progress_bar_enabled")] | |||||
public Optional<bool> IsBoostProgressBarEnabled { get; set; } | |||||
} | } | ||||
} | } |
@@ -36,7 +36,8 @@ namespace Discord.Rest | |||||
Banner = args.Banner.IsSpecified ? args.Banner.Value?.ToModel() : Optional.Create<ImageModel?>(), | Banner = args.Banner.IsSpecified ? args.Banner.Value?.ToModel() : Optional.Create<ImageModel?>(), | ||||
VerificationLevel = args.VerificationLevel, | VerificationLevel = args.VerificationLevel, | ||||
ExplicitContentFilter = args.ExplicitContentFilter, | ExplicitContentFilter = args.ExplicitContentFilter, | ||||
SystemChannelFlags = args.SystemChannelFlags | |||||
SystemChannelFlags = args.SystemChannelFlags, | |||||
IsBoostProgressBarEnabled = args.IsBoostProgressBarEnabled | |||||
}; | }; | ||||
if (args.AfkChannel.IsSpecified) | if (args.AfkChannel.IsSpecified) | ||||
@@ -88,6 +88,8 @@ namespace Discord.Rest | |||||
public int? ApproximatePresenceCount { get; private set; } | public int? ApproximatePresenceCount { get; private set; } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public NsfwLevel NsfwLevel { get; private set; } | public NsfwLevel NsfwLevel { get; private set; } | ||||
/// <inheritdoc /> | |||||
public bool IsBoostProgressBarEnabled { get; private set; } | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public CultureInfo PreferredCulture { get; private set; } | public CultureInfo PreferredCulture { get; private set; } | ||||
@@ -170,6 +172,8 @@ namespace Discord.Rest | |||||
ApproximateMemberCount = model.ApproximateMemberCount.Value; | ApproximateMemberCount = model.ApproximateMemberCount.Value; | ||||
if (model.ApproximatePresenceCount.IsSpecified) | if (model.ApproximatePresenceCount.IsSpecified) | ||||
ApproximatePresenceCount = model.ApproximatePresenceCount.Value; | ApproximatePresenceCount = model.ApproximatePresenceCount.Value; | ||||
if (model.IsBoostProgressBarEnabled.IsSpecified) | |||||
IsBoostProgressBarEnabled = model.IsBoostProgressBarEnabled.Value; | |||||
if (model.Emojis != null) | if (model.Emojis != null) | ||||
{ | { | ||||
@@ -125,9 +125,10 @@ namespace Discord.WebSocket | |||||
public int? MaxVideoChannelUsers { get; private set; } | public int? MaxVideoChannelUsers { get; private set; } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public NsfwLevel NsfwLevel { get; private set; } | public NsfwLevel NsfwLevel { get; private set; } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public CultureInfo PreferredCulture { get; private set; } | public CultureInfo PreferredCulture { get; private set; } | ||||
/// <inheritdoc /> | |||||
public bool IsBoostProgressBarEnabled { get; private set; } | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id); | public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id); | ||||
@@ -495,7 +496,8 @@ namespace Discord.WebSocket | |||||
MaxVideoChannelUsers = model.MaxVideoChannelUsers.Value; | MaxVideoChannelUsers = model.MaxVideoChannelUsers.Value; | ||||
PreferredLocale = model.PreferredLocale; | PreferredLocale = model.PreferredLocale; | ||||
PreferredCulture = PreferredLocale == null ? null : new CultureInfo(PreferredLocale); | PreferredCulture = PreferredLocale == null ? null : new CultureInfo(PreferredLocale); | ||||
if (model.IsBoostProgressBarEnabled.IsSpecified) | |||||
IsBoostProgressBarEnabled = model.IsBoostProgressBarEnabled.Value; | |||||
if (model.Emojis != null) | if (model.Emojis != null) | ||||
{ | { | ||||
var emojis = ImmutableArray.CreateBuilder<GuildEmote>(model.Emojis.Length); | var emojis = ImmutableArray.CreateBuilder<GuildEmote>(model.Emojis.Length); | ||||
@@ -1627,7 +1629,6 @@ namespace Discord.WebSocket | |||||
int? IGuild.ApproximatePresenceCount => null; | int? IGuild.ApproximatePresenceCount => null; | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
IReadOnlyCollection<ICustomSticker> IGuild.Stickers => Stickers; | IReadOnlyCollection<ICustomSticker> IGuild.Stickers => Stickers; | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
async Task<IReadOnlyCollection<IBan>> IGuild.GetBansAsync(RequestOptions options) | async Task<IReadOnlyCollection<IBan>> IGuild.GetBansAsync(RequestOptions options) | ||||
=> await GetBansAsync(options).ConfigureAwait(false); | => await GetBansAsync(options).ConfigureAwait(false); | ||||
@@ -12,8 +12,6 @@ namespace Discord.WebSocket | |||||
public override string Username { get; internal set; } | public override string Username { get; internal set; } | ||||
public override ushort DiscriminatorValue { get; internal set; } | public override ushort DiscriminatorValue { get; internal set; } | ||||
public override string AvatarId { get; internal set; } | public override string AvatarId { get; internal set; } | ||||
public override string BannerId { get; internal set; } | |||||
public override Color? AccentColor { get; internal set; } | |||||
internal override SocketPresence Presence { get; set; } | internal override SocketPresence Presence { get; set; } | ||||
public override bool IsWebhook => false; | public override bool IsWebhook => false; | ||||
@@ -30,10 +30,6 @@ namespace Discord.WebSocket | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public override string AvatarId { get { return GlobalUser.AvatarId; } internal set { GlobalUser.AvatarId = value; } } | public override string AvatarId { get { return GlobalUser.AvatarId; } internal set { GlobalUser.AvatarId = value; } } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public override string BannerId { get { return GlobalUser.BannerId; } internal set { GlobalUser.BannerId = value; } } | |||||
/// <inheritdoc /> | |||||
public override Color? AccentColor { get { return GlobalUser.AccentColor; } internal set { GlobalUser.AccentColor = value; } } | |||||
/// <inheritdoc /> | |||||
internal override SocketPresence Presence { get { return GlobalUser.Presence; } set { GlobalUser.Presence = value; } } | internal override SocketPresence Presence { get { return GlobalUser.Presence; } set { GlobalUser.Presence = value; } } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
@@ -40,10 +40,6 @@ namespace Discord.WebSocket | |||||
public override ushort DiscriminatorValue { get { return GlobalUser.DiscriminatorValue; } internal set { GlobalUser.DiscriminatorValue = value; } } | public override ushort DiscriminatorValue { get { return GlobalUser.DiscriminatorValue; } internal set { GlobalUser.DiscriminatorValue = value; } } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public override string AvatarId { get { return GlobalUser.AvatarId; } internal set { GlobalUser.AvatarId = value; } } | public override string AvatarId { get { return GlobalUser.AvatarId; } internal set { GlobalUser.AvatarId = value; } } | ||||
/// <inheritdoc /> | |||||
public override string BannerId { get { return GlobalUser.BannerId; } internal set { GlobalUser.BannerId = value; } } | |||||
/// <inheritdoc /> | |||||
public override Color? AccentColor { get { return GlobalUser.AccentColor; } internal set { GlobalUser.AccentColor = value; } } | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public GuildPermissions GuildPermissions => new GuildPermissions(Permissions.ResolveGuild(Guild, this)); | public GuildPermissions GuildPermissions => new GuildPermissions(Permissions.ResolveGuild(Guild, this)); | ||||
@@ -29,10 +29,6 @@ namespace Discord.WebSocket | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public override string AvatarId { get { return GlobalUser.AvatarId; } internal set { GlobalUser.AvatarId = value; } } | public override string AvatarId { get { return GlobalUser.AvatarId; } internal set { GlobalUser.AvatarId = value; } } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public override string BannerId { get { return GlobalUser.BannerId; } internal set { GlobalUser.BannerId = value; } } | |||||
/// <inheritdoc /> | |||||
public override Color? AccentColor { get { return GlobalUser.AccentColor; } internal set { GlobalUser.AccentColor = value; } } | |||||
/// <inheritdoc /> | |||||
internal override SocketPresence Presence { get { return GlobalUser.Presence; } set { GlobalUser.Presence = value; } } | internal override SocketPresence Presence { get { return GlobalUser.Presence; } set { GlobalUser.Presence = value; } } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public UserProperties Flags { get; internal set; } | public UserProperties Flags { get; internal set; } | ||||
@@ -56,20 +56,6 @@ namespace Discord.WebSocket | |||||
public string GuildAvatarId | public string GuildAvatarId | ||||
=> GuildUser.GuildAvatarId; | => GuildUser.GuildAvatarId; | ||||
/// <inheritdoc/> | |||||
public override string BannerId | |||||
{ | |||||
get => GuildUser.BannerId; | |||||
internal set => GuildUser.BannerId = value; | |||||
} | |||||
/// <inheritdoc/> | |||||
public override Color? AccentColor | |||||
{ | |||||
get => GuildUser.AccentColor; | |||||
internal set => GuildUser.AccentColor = value; | |||||
} | |||||
/// <inheritdoc/> | /// <inheritdoc/> | ||||
public override ushort DiscriminatorValue | public override ushort DiscriminatorValue | ||||
{ | { | ||||
@@ -20,12 +20,6 @@ namespace Discord.WebSocket | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public override string AvatarId { get; internal set; } | public override string AvatarId { get; internal set; } | ||||
/// <inheritdoc /> | |||||
public override string BannerId { get; internal set; } | |||||
/// <inheritdoc /> | |||||
public override Color? AccentColor { get; internal set; } | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public override bool IsBot { get; internal set; } | public override bool IsBot { get; internal set; } | ||||
@@ -25,10 +25,6 @@ namespace Discord.WebSocket | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public abstract string AvatarId { get; internal set; } | public abstract string AvatarId { get; internal set; } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public abstract string BannerId { get; internal set; } | |||||
/// <inheritdoc /> | |||||
public abstract Color? AccentColor { get; internal set; } | |||||
/// <inheritdoc /> | |||||
public abstract bool IsWebhook { get; } | public abstract bool IsWebhook { get; } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public UserProperties? PublicFlags { get; private set; } | public UserProperties? PublicFlags { get; private set; } | ||||
@@ -68,16 +64,6 @@ namespace Discord.WebSocket | |||||
AvatarId = model.Avatar.Value; | AvatarId = model.Avatar.Value; | ||||
hasChanges = true; | hasChanges = true; | ||||
} | } | ||||
if (model.Banner.IsSpecified && model.Banner.Value != BannerId) | |||||
{ | |||||
BannerId = model.Banner.Value; | |||||
hasChanges = true; | |||||
} | |||||
if (model.AccentColor.IsSpecified && model.AccentColor.Value != AccentColor?.RawValue) | |||||
{ | |||||
AccentColor = model.AccentColor.Value; | |||||
hasChanges = true; | |||||
} | |||||
if (model.Discriminator.IsSpecified) | if (model.Discriminator.IsSpecified) | ||||
{ | { | ||||
var newVal = ushort.Parse(model.Discriminator.Value, NumberStyles.None, CultureInfo.InvariantCulture); | var newVal = ushort.Parse(model.Discriminator.Value, NumberStyles.None, CultureInfo.InvariantCulture); | ||||
@@ -113,10 +99,6 @@ namespace Discord.WebSocket | |||||
public string GetAvatarUrl(ImageFormat format = ImageFormat.Auto, ushort size = 128) | public string GetAvatarUrl(ImageFormat format = ImageFormat.Auto, ushort size = 128) | ||||
=> CDN.GetUserAvatarUrl(Id, AvatarId, size, format); | => CDN.GetUserAvatarUrl(Id, AvatarId, size, format); | ||||
/// <inheritdoc /> | |||||
public string GetBannerUrl(ImageFormat format = ImageFormat.Auto, ushort size = 256) | |||||
=> CDN.GetUserBannerUrl(Id, BannerId, size, format); | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public string GetDefaultAvatarUrl() | public string GetDefaultAvatarUrl() | ||||
=> CDN.GetDefaultUserAvatarUrl(DiscriminatorValue); | => CDN.GetDefaultUserAvatarUrl(DiscriminatorValue); | ||||
@@ -26,21 +26,6 @@ namespace Discord.WebSocket | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public override string AvatarId { get; internal set; } | public override string AvatarId { get; internal set; } | ||||
/// <inheritdoc /> | |||||
/// <exception cref="NotSupportedException">Webhook users does not support banners.</exception> | |||||
public override string BannerId | |||||
{ | |||||
get => throw new NotSupportedException("Webhook users does not support banners."); | |||||
internal set => throw new NotSupportedException("Webhook users does not support banners."); | |||||
} | |||||
/// <inheritdoc /> | |||||
/// <exception cref="NotSupportedException">Webhook users does not support accent colors.</exception> | |||||
public override Color? AccentColor | |||||
{ | |||||
get => throw new NotSupportedException("Webhook users does not support accent colors."); | |||||
internal set => throw new NotSupportedException("Webhook users does not support accent colors."); | |||||
} | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public override bool IsBot { get; internal set; } | public override bool IsBot { get; internal set; } | ||||