[Feature] Polls (#2902)

no breakings hopefully
This commit is contained in:
Mihail Gribkov
2024-05-11 23:34:12 +03:00
committed by GitHub
parent 5dadcb2e30
commit 476ec068f1
75 changed files with 1372 additions and 424 deletions

View File

@@ -48,6 +48,9 @@ namespace Discord.API.Rest
[JsonProperty("applied_tags")]
public Optional<ulong[]> AppliedTags { get; set; }
[JsonProperty("poll")]
public Optional<CreatePollParams> Poll { get; set; }
public IReadOnlyDictionary<string, object> ToDictionary()
{
var d = new Dictionary<string, object>();
@@ -80,6 +83,11 @@ namespace Discord.API.Rest
payload["thread_name"] = ThreadName.Value;
if (AppliedTags.IsSpecified)
payload["applied_tags"] = AppliedTags.Value;
if (Flags.IsSpecified)
payload["flags"] = Flags.Value;
if (Poll.IsSpecified)
payload["poll"] = Poll.Value;
var json = new StringBuilder();
using (var text = new StringWriter(json))