Browse Source

Add ExplicitContentFilter property to Guild

pull/1165/head
Chris Johnston 7 years ago
parent
commit
5b329048de
5 changed files with 22 additions and 1 deletions
  1. +13
    -0
      src/Discord.Net.Core/Entities/Guilds/ExplicitContentFilterLevel.cs
  2. +2
    -0
      src/Discord.Net.Core/Entities/Guilds/IGuild.cs
  3. +3
    -1
      src/Discord.Net.Rest/API/Common/Guild.cs
  4. +2
    -0
      src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs
  5. +2
    -0
      src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs

+ 13
- 0
src/Discord.Net.Core/Entities/Guilds/ExplicitContentFilterLevel.cs View File

@@ -0,0 +1,13 @@
namespace Discord
{
public enum ExplicitContentFilterLevel
{
/// <summary> No messages will be scanned. </summary>
Disabled = 0,
/// <summary> Scans messages from all guild members that do not have a role. </summary>
/// <remarks> Recommented option for servers that use roles for trusted membership. </remarks>
MembersWithoutRoles = 1,
/// <summary> Scan messages sent by all guild members. </summary>
AllMembers = 2
}
}

+ 2
- 0
src/Discord.Net.Core/Entities/Guilds/IGuild.cs View File

@@ -19,6 +19,8 @@ namespace Discord
MfaLevel MfaLevel { get; }
/// <summary> Gets the level of requirements a user must fulfill before being allowed to post messages in this guild. </summary>
VerificationLevel VerificationLevel { get; }
/// <summary> Gets the level of content filtering applied to user's content in a Guild. </summary>
ExplicitContentFilterLevel ExplicitContentFilterLevel { get; }
/// <summary> Returns the id of this guild's icon, or null if one is not set. </summary>
string IconId { get; }
/// <summary> Returns the url to this guild's icon, or null if one is not set. </summary>


+ 3
- 1
src/Discord.Net.Rest/API/Common/Guild.cs View File

@@ -1,4 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable CS1591
using Newtonsoft.Json;

namespace Discord.API
@@ -41,5 +41,7 @@ namespace Discord.API
public MfaLevel MfaLevel { get; set; }
[JsonProperty("default_message_notifications")]
public DefaultMessageNotifications DefaultMessageNotifications { get; set; }
[JsonProperty("explicit_content_filter")]
public ExplicitContentFilterLevel ExplicitContentFilter { get; set; }
}
}

+ 2
- 0
src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs View File

@@ -23,6 +23,7 @@ namespace Discord.Rest
public VerificationLevel VerificationLevel { get; private set; }
public MfaLevel MfaLevel { get; private set; }
public DefaultMessageNotifications DefaultMessageNotifications { get; private set; }
public ExplicitContentFilterLevel ExplicitContentFilter { get; private set; }

public ulong? AFKChannelId { get; private set; }
public ulong? EmbedChannelId { get; private set; }
@@ -70,6 +71,7 @@ namespace Discord.Rest
VerificationLevel = model.VerificationLevel;
MfaLevel = model.MfaLevel;
DefaultMessageNotifications = model.DefaultMessageNotifications;
ExplicitContentFilter = model.ExplicitContentFilter;

if (model.Emojis != null)
{


+ 2
- 0
src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs View File

@@ -40,6 +40,7 @@ namespace Discord.WebSocket
public VerificationLevel VerificationLevel { get; private set; }
public MfaLevel MfaLevel { get; private set; }
public DefaultMessageNotifications DefaultMessageNotifications { get; private set; }
public ExplicitContentFilterLevel ExplicitContentFilter { get; private set; }
public int MemberCount { get; internal set; }
public int DownloadedMemberCount { get; private set; }
internal bool IsAvailable { get; private set; }
@@ -210,6 +211,7 @@ namespace Discord.WebSocket
VerificationLevel = model.VerificationLevel;
MfaLevel = model.MfaLevel;
DefaultMessageNotifications = model.DefaultMessageNotifications;
ExplicitContentFilter = model.ExplicitContentFilter;

if (model.Emojis != null)
{


Loading…
Cancel
Save