From cbe06cacace39522e913656833164eed5c9c852d Mon Sep 17 00:00:00 2001 From: Chris Johnston Date: Tue, 4 Jun 2019 21:12:07 -0700 Subject: [PATCH] implement additional model properties in IGuild types --- .../Entities/Guilds/IGuild.cs | 35 +++++++++++++++++++ .../Entities/Guilds/RestGuild.cs | 14 ++++++++ .../Entities/Guilds/SocketGuild.cs | 14 ++++++++ 3 files changed, 63 insertions(+) diff --git a/src/Discord.Net.Core/Entities/Guilds/IGuild.cs b/src/Discord.Net.Core/Entities/Guilds/IGuild.cs index 571afef15..69135208a 100644 --- a/src/Discord.Net.Core/Entities/Guilds/IGuild.cs +++ b/src/Discord.Net.Core/Entities/Guilds/IGuild.cs @@ -196,6 +196,41 @@ namespace Discord /// A read-only collection of roles found within this guild. /// IReadOnlyCollection Roles { get; } + /// + /// Gets the tier of guild boosting in this guild. + /// + /// + /// The tier of guild boosting in this guild. + /// + PremiumTier PremiumTier { get; } + /// + /// Gets the identifier for this guilds vanity image. + /// + /// + /// An identifier for the vanity image; null if none is set. + /// + string VanityId { get; } + /// + /// Gets the URL of this guild's vanity image. + /// + /// + /// A URL pointing to the guild's vanity image; null if none is set. + /// + string VanityUrl { get; } + /// + /// Gets the flags for the types of system channels that are disabled. + /// + /// + /// The flags for the types of system channel flags that are disabled. + /// + SystemChannelMessageDeny SystemChannelFlags { get; } + /// + /// Gets the description for the guild. + /// + /// + /// The description for the guild; null if none is set. + /// + string Description { get; } /// /// Modifies this guild. diff --git a/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs b/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs index 902d2c9a8..b60e3843a 100644 --- a/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs +++ b/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs @@ -52,6 +52,14 @@ namespace Discord.Rest internal bool Available { get; private set; } /// public ulong? ApplicationId { get; private set; } + /// + public PremiumTier PremiumTier { get; private set; } + /// + public string VanityId { get; private set; } + /// + public SystemChannelMessageDeny SystemChannelFlags { get; private set; } + /// + public string Description { get; private set; } /// public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id); @@ -62,6 +70,8 @@ namespace Discord.Rest public string IconUrl => CDN.GetGuildIconUrl(Id, IconId); /// public string SplashUrl => CDN.GetGuildSplashUrl(Id, SplashId); + /// + public string VanityUrl => CDN.GetGuildVanityUrl(Id, VanityId); /// /// Gets the built-in role containing all users in this guild. @@ -104,6 +114,10 @@ namespace Discord.Rest DefaultMessageNotifications = model.DefaultMessageNotifications; ExplicitContentFilter = model.ExplicitContentFilter; ApplicationId = model.ApplicationId; + PremiumTier = model.PremiumTier; + VanityId = model.VanityURLCode; + SystemChannelFlags = model.SystemChannelFlags; + Description = model.Description; if (model.Emojis != null) { diff --git a/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs b/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs index d952b3d92..06cf636ed 100644 --- a/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs +++ b/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs @@ -93,6 +93,14 @@ namespace Discord.WebSocket public string IconId { get; private set; } /// public string SplashId { get; private set; } + /// + public PremiumTier PremiumTier { get; private set; } + /// + public string VanityId { get; private set; } + /// + public SystemChannelMessageDeny SystemChannelFlags { get; private set; } + /// + public string Description { get; private set; } /// public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id); @@ -100,6 +108,8 @@ namespace Discord.WebSocket public string IconUrl => CDN.GetGuildIconUrl(Id, IconId); /// public string SplashUrl => CDN.GetGuildSplashUrl(Id, SplashId); + /// + public string VanityUrl => CDN.GetGuildVanityUrl(Id, VanityId); /// Indicates whether the client has all the members downloaded to the local guild cache. public bool HasAllMembers => MemberCount == DownloadedMemberCount;// _downloaderPromise.Task.IsCompleted; /// Indicates whether the guild cache is synced to this guild. @@ -354,6 +364,10 @@ namespace Discord.WebSocket DefaultMessageNotifications = model.DefaultMessageNotifications; ExplicitContentFilter = model.ExplicitContentFilter; ApplicationId = model.ApplicationId; + PremiumTier = model.PremiumTier; + VanityId = model.VanityURLCode; + SystemChannelFlags = model.SystemChannelFlags; + Description = model.Description; if (model.Emojis != null) {