* Removed BannerId property, GetBannerURL method, and AccentColor property from IUser and socket entities. * Fixed errors in IUser.cs * Added back summary for GetAvatarUrl method in IUser.cspull/1923/head
@@ -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> | ||||
@@ -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; } | ||||