Browse Source

Add IsNsfw to TextChannelProperties

pull/805/head
Christopher F 7 years ago
parent
commit
4846264074
3 changed files with 8 additions and 1 deletions
  1. +4
    -0
      src/Discord.Net.Core/Entities/Channels/TextChannelProperties.cs
  2. +2
    -0
      src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs
  3. +2
    -1
      src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs

+ 4
- 0
src/Discord.Net.Core/Entities/Channels/TextChannelProperties.cs View File

@@ -7,5 +7,9 @@
/// What the topic of the channel should be set to.
/// </summary>
public Optional<string> Topic { get; set; }
/// <summary>
/// Should this channel be flagged as NSFW?
/// </summary>
public Optional<bool> IsNsfw { get; set; }
}
}

+ 2
- 0
src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs View File

@@ -8,5 +8,7 @@ namespace Discord.API.Rest
{
[JsonProperty("topic")]
public Optional<string> Topic { get; set; }
[JsonProperty("nsfw")]
public Optional<bool> IsNsfw { get; set; }
}
}

+ 2
- 1
src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs View File

@@ -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);
}


Loading…
Cancel
Save