a mistake was made somewhere, that's all I know for surepull/1319/head
| @@ -78,18 +78,18 @@ namespace Discord | |||
| => iconId != null ? $"{DiscordConfig.CDNUrl}channel-icons/{channelId}/{iconId}.jpg" : null; | |||
| /// <summary> | |||
| /// Returns a guild vanity URL. | |||
| /// Returns a guild banner URL. | |||
| /// </summary> | |||
| /// <param name="guildId">The guild snowflake identifier.</param> | |||
| /// <param name="vanityId">The vanity image identifier.</param> | |||
| /// <param name="size">The size of the image to return in horizontal pixels. This can be any power of two between 16 and 2048.</param> | |||
| /// <param name="bannerId">The banner image identifier.</param> | |||
| /// <param name="size">The size of the image to return in horizontal pixels. This can be any power of two between 16 and 2048 inclusive.</param> | |||
| /// <returns> | |||
| /// A URL pointing to the guild's vanity image. | |||
| /// A URL pointing to the guild's banner image. | |||
| /// </returns> | |||
| public static string GetGuildVanityUrl(ulong guildId, string vanityId, ushort? size = null) | |||
| public static string GetGuildBannerUrl(ulong guildId, string bannerId, ushort? size = null) | |||
| { | |||
| if (!string.IsNullOrEmpty(vanityId)) | |||
| return $"{DiscordConfig.CDNUrl}banners/{guildId}/{vanityId}.jpg" + (size.HasValue ? $"?size={size}" : string.Empty); | |||
| if (!string.IsNullOrEmpty(bannerId)) | |||
| return $"{DiscordConfig.CDNUrl}banners/{guildId}/{bannerId}.jpg" + (size.HasValue ? $"?size={size}" : string.Empty); | |||
| return null; | |||
| } | |||
| /// <summary> | |||
| @@ -204,19 +204,29 @@ namespace Discord | |||
| /// </returns> | |||
| PremiumTier PremiumTier { get; } | |||
| /// <summary> | |||
| /// Gets the identifier for this guilds vanity image. | |||
| /// Gets the identifier for this guilds banner image. | |||
| /// </summary> | |||
| /// <returns> | |||
| /// An identifier for the banner image; <c>null</c> if none is set. | |||
| /// </returns> | |||
| string BannerId { get; } | |||
| /// <summary> | |||
| /// Gets the URL of this guild's banner image. | |||
| /// </summary> | |||
| /// <remarks> | |||
| /// An identifier for the vanity image; <c>null</c> if none is set. | |||
| /// This is referred to as the vanity image in the API. | |||
| /// </remarks> | |||
| string VanityId { get; } | |||
| /// <returns> | |||
| /// A URL pointing to the guild's banner image; <c>null</c> if none is set. | |||
| /// </returns> | |||
| string BannerUrl { get; } | |||
| /// <summary> | |||
| /// Gets the URL of this guild's vanity image. | |||
| /// Gets the code for this guild's vanity invite URL. | |||
| /// </summary> | |||
| /// <returns> | |||
| /// A URL pointing to the guild's vanity image; <c>null</c> if none is set. | |||
| /// A string containing the vanity invite code for this guild; <c>null</c> if none is set. | |||
| /// </returns> | |||
| string VanityUrl { get; } | |||
| string VanityURLCode { get; } | |||
| /// <summary> | |||
| /// Gets the flags for the types of system channels that are disabled. | |||
| /// </summary> | |||
| @@ -49,6 +49,8 @@ namespace Discord.API | |||
| public PremiumTier PremiumTier { get; set; } | |||
| [JsonProperty("vanity_url_code")] | |||
| public string VanityURLCode { get; set; } | |||
| [JsonProperty("banner")] | |||
| public string Banner { get; set; } | |||
| [JsonProperty("description")] | |||
| public string Description { get; set; } | |||
| // this value is inverted, flags set will turn OFF features | |||
| @@ -55,7 +55,9 @@ namespace Discord.Rest | |||
| /// <inheritdoc /> | |||
| public PremiumTier PremiumTier { get; private set; } | |||
| /// <inheritdoc /> | |||
| public string VanityId { get; private set; } | |||
| public string BannerId { get; private set; } | |||
| /// <inheritdoc /> | |||
| public string VanityURLCode { get; private set; } | |||
| /// <inheritdoc /> | |||
| public SystemChannelMessageDeny SystemChannelFlags { get; private set; } | |||
| /// <inheritdoc /> | |||
| @@ -73,7 +75,7 @@ namespace Discord.Rest | |||
| /// <inheritdoc /> | |||
| public string SplashUrl => CDN.GetGuildSplashUrl(Id, SplashId); | |||
| /// <inheritdoc /> | |||
| public string VanityUrl => CDN.GetGuildVanityUrl(Id, VanityId); | |||
| public string BannerUrl => CDN.GetGuildBannerUrl(Id, BannerId); | |||
| /// <summary> | |||
| /// Gets the built-in role containing all users in this guild. | |||
| @@ -117,10 +119,12 @@ namespace Discord.Rest | |||
| ExplicitContentFilter = model.ExplicitContentFilter; | |||
| ApplicationId = model.ApplicationId; | |||
| PremiumTier = model.PremiumTier; | |||
| VanityId = model.VanityURLCode; | |||
| VanityURLCode = model.VanityURLCode; | |||
| BannerId = model.Banner; | |||
| SystemChannelFlags = model.SystemChannelFlags; | |||
| Description = model.Description; | |||
| PremiumSubscriptionCount = model.PremiumSubscriptionCount.GetValueOrDefault(); | |||
| if (model.PremiumSubscriptionCount.IsSpecified) | |||
| PremiumSubscriptionCount = model.PremiumSubscriptionCount.Value; | |||
| if (model.Emojis != null) | |||
| { | |||
| @@ -96,7 +96,9 @@ namespace Discord.WebSocket | |||
| /// <inheritdoc /> | |||
| public PremiumTier PremiumTier { get; private set; } | |||
| /// <inheritdoc /> | |||
| public string VanityId { get; private set; } | |||
| public string BannerId { get; private set; } | |||
| /// <inheritdoc /> | |||
| public string VanityURLCode { get; private set; } | |||
| /// <inheritdoc /> | |||
| public SystemChannelMessageDeny SystemChannelFlags { get; private set; } | |||
| /// <inheritdoc /> | |||
| @@ -111,7 +113,7 @@ namespace Discord.WebSocket | |||
| /// <inheritdoc /> | |||
| public string SplashUrl => CDN.GetGuildSplashUrl(Id, SplashId); | |||
| /// <inheritdoc /> | |||
| public string VanityUrl => CDN.GetGuildVanityUrl(Id, VanityId); | |||
| public string BannerUrl => CDN.GetGuildBannerUrl(Id, BannerId); | |||
| /// <summary> Indicates whether the client has all the members downloaded to the local guild cache. </summary> | |||
| public bool HasAllMembers => MemberCount == DownloadedMemberCount;// _downloaderPromise.Task.IsCompleted; | |||
| /// <summary> Indicates whether the guild cache is synced to this guild. </summary> | |||
| @@ -367,7 +369,8 @@ namespace Discord.WebSocket | |||
| ExplicitContentFilter = model.ExplicitContentFilter; | |||
| ApplicationId = model.ApplicationId; | |||
| PremiumTier = model.PremiumTier; | |||
| VanityId = model.VanityURLCode; | |||
| VanityURLCode = model.VanityURLCode; | |||
| BannerId = model.Banner; | |||
| SystemChannelFlags = model.SystemChannelFlags; | |||
| Description = model.Description; | |||
| PremiumSubscriptionCount = model.PremiumSubscriptionCount.GetValueOrDefault(); | |||