From 484626407472427e4f2aad9cdab2dc75feb7a611 Mon Sep 17 00:00:00 2001 From: Christopher F Date: Tue, 29 Aug 2017 17:42:00 -0400 Subject: [PATCH] Add IsNsfw to TextChannelProperties --- src/Discord.Net.Core/Entities/Channels/TextChannelProperties.cs | 4 ++++ src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs | 2 ++ src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Discord.Net.Core/Entities/Channels/TextChannelProperties.cs b/src/Discord.Net.Core/Entities/Channels/TextChannelProperties.cs index 2461a09f2..b7b568133 100644 --- a/src/Discord.Net.Core/Entities/Channels/TextChannelProperties.cs +++ b/src/Discord.Net.Core/Entities/Channels/TextChannelProperties.cs @@ -7,5 +7,9 @@ /// What the topic of the channel should be set to. /// public Optional Topic { get; set; } + /// + /// Should this channel be flagged as NSFW? + /// + public Optional IsNsfw { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs index 311336ec3..9cabc67c1 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs @@ -8,5 +8,7 @@ namespace Discord.API.Rest { [JsonProperty("topic")] public Optional Topic { get; set; } + [JsonProperty("nsfw")] + public Optional IsNsfw { get; set; } } } diff --git a/src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs b/src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs index 30c28bacb..d61b5d14a 100644 --- a/src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs +++ b/src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs @@ -41,7 +41,8 @@ namespace Discord.Rest { Name = args.Name, Position = args.Position, - Topic = args.Topic + Topic = args.Topic, + IsNsfw = args.IsNsfw }; return await client.ApiClient.ModifyGuildChannelAsync(channel.Id, apiArgs, options).ConfigureAwait(false); }