From 6dcc1ed14c7029a6a28b84efd5d67d89a1d3b6c6 Mon Sep 17 00:00:00 2001 From: Chris Johnston Date: Fri, 28 Sep 2018 21:03:20 -0700 Subject: [PATCH] Implement ApplicationId in Guild model --- src/Discord.Net.Core/Entities/Guilds/IGuild.cs | 8 ++++++++ src/Discord.Net.Rest/API/Common/Guild.cs | 2 ++ src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs | 4 +++- src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs | 2 ++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Discord.Net.Core/Entities/Guilds/IGuild.cs b/src/Discord.Net.Core/Entities/Guilds/IGuild.cs index 8f9108d95..989eb403b 100644 --- a/src/Discord.Net.Core/Entities/Guilds/IGuild.cs +++ b/src/Discord.Net.Core/Entities/Guilds/IGuild.cs @@ -52,6 +52,8 @@ namespace Discord /// The level of requirements. /// VerificationLevel VerificationLevel { get; } + /// Gets the level of content filtering applied to user's content in a Guild. + ExplicitContentFilterLevel ExplicitContentFilter { get; } /// /// Gets the ID of this guild's icon. /// @@ -133,12 +135,18 @@ namespace Discord /// welcome messages are sent; null if none is set. /// ulong? SystemChannelId { get; } +<<<<<<< HEAD /// /// Gets the ID of the user that owns this guild. /// /// /// A representing the snowflake identifier of the user that owns this guild. /// +======= + /// Gets the application id of the guild creator if it is bot-created. + ulong? ApplicationId { get; } + /// Gets the id of the user that created this guild. +>>>>>>> Implement ApplicationId in Guild model ulong OwnerId { get; } /// /// Gets the ID of the region hosting this guild's voice channels. diff --git a/src/Discord.Net.Rest/API/Common/Guild.cs b/src/Discord.Net.Rest/API/Common/Guild.cs index be45ac3fa..a84b55a93 100644 --- a/src/Discord.Net.Rest/API/Common/Guild.cs +++ b/src/Discord.Net.Rest/API/Common/Guild.cs @@ -41,6 +41,8 @@ namespace Discord.API public string[] Features { get; set; } [JsonProperty("mfa_level")] public MfaLevel MfaLevel { get; set; } + [JsonProperty("application_id")] + public ulong? ApplicationId { get; set; } [JsonProperty("system_channel_id")] public ulong? SystemChannelId { get; set; } } diff --git a/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs b/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs index f94936edd..c04d18161 100644 --- a/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs +++ b/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs @@ -49,6 +49,7 @@ namespace Discord.Rest /// public string SplashId { get; private set; } internal bool Available { get; private set; } + public ulong? ApplicationId { get; private set; } /// public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id); @@ -99,7 +100,8 @@ namespace Discord.Rest VerificationLevel = model.VerificationLevel; MfaLevel = model.MfaLevel; DefaultMessageNotifications = model.DefaultMessageNotifications; - ExplicitContentFilter = model.ExplicitContentFilter; + ExplicitContentFilter = model.ExplicitContentFilter; + ApplicationId = model.ApplicationId; 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 332d2f4de..cc05bffb5 100644 --- a/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs +++ b/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs @@ -75,6 +75,7 @@ namespace Discord.WebSocket internal bool IsAvailable { get; private set; } /// Indicates whether the client is connected to this guild. public bool IsConnected { get; internal set; } + public ulong? ApplicationId { get; internal set; } internal ulong? AFKChannelId { get; private set; } internal ulong? EmbedChannelId { get; private set; } @@ -349,6 +350,7 @@ namespace Discord.WebSocket MfaLevel = model.MfaLevel; DefaultMessageNotifications = model.DefaultMessageNotifications; ExplicitContentFilter = model.ExplicitContentFilter; + ApplicationId = model.ApplicationId; if (model.Emojis != null) {