Create forum posts with DiscordWebhookClient (#2603)
This commit is contained in:
@@ -42,6 +42,9 @@ namespace Discord.API.Rest
|
||||
[JsonProperty("file")]
|
||||
public Optional<MultipartFile> File { get; set; }
|
||||
|
||||
[JsonProperty("thread_name")]
|
||||
public Optional<string> ThreadName { get; set; }
|
||||
|
||||
public IReadOnlyDictionary<string, object> ToDictionary()
|
||||
{
|
||||
var d = new Dictionary<string, object>();
|
||||
@@ -70,6 +73,8 @@ namespace Discord.API.Rest
|
||||
payload["allowed_mentions"] = AllowedMentions.Value;
|
||||
if (Components.IsSpecified)
|
||||
payload["components"] = Components.Value;
|
||||
if (ThreadName.IsSpecified)
|
||||
payload["thread_name"] = ThreadName.Value;
|
||||
|
||||
var json = new StringBuilder();
|
||||
using (var text = new StringWriter(json))
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace Discord.API.Rest
|
||||
public Optional<AllowedMentions> AllowedMentions { get; set; }
|
||||
public Optional<ActionRowComponent[]> MessageComponents { get; set; }
|
||||
public Optional<MessageFlags> Flags { get; set; }
|
||||
public Optional<string> ThreadName { get; set; }
|
||||
|
||||
public UploadWebhookFileParams(params FileAttachment[] files)
|
||||
{
|
||||
@@ -51,6 +52,8 @@ namespace Discord.API.Rest
|
||||
payload["allowed_mentions"] = AllowedMentions.Value;
|
||||
if (Flags.IsSpecified)
|
||||
payload["flags"] = Flags.Value;
|
||||
if (ThreadName.IsSpecified)
|
||||
payload["thread_name"] = ThreadName.Value;
|
||||
|
||||
List<object> attachments = new();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user