[Feature] Add MessageCallData (#2934)

This commit is contained in:
Mihail Gribkov
2024-06-14 11:23:34 +03:00
committed by GitHub
parent 35b102a7c0
commit 21195a8a93
6 changed files with 58 additions and 0 deletions

View File

@@ -104,4 +104,7 @@ internal class Message
[JsonProperty("poll")]
public Optional<Poll> Poll { get; set; }
[JsonProperty("call")]
public Optional<MessageCallData> Call { get; set; }
}

View File

@@ -0,0 +1,13 @@
using Newtonsoft.Json;
using System;
namespace Discord.API;
internal class MessageCallData
{
[JsonProperty("ended_timestamp")]
public Optional<DateTimeOffset> EndedTimestamp { get; set; }
[JsonProperty("participants")]
public ulong[] Participants { get; set; }
}

View File

@@ -93,6 +93,9 @@ namespace Discord.Rest
/// <inheritdoc />
public MessageRoleSubscriptionData RoleSubscriptionData { get; private set; }
/// <inheritdoc />
public MessageCallData? CallData { get; private set; }
/// <inheritdoc cref="IMessage.Components"/>
public IReadOnlyCollection<ActionRowComponent> Components { get; private set; }
/// <summary>
@@ -272,6 +275,9 @@ namespace Discord.Rest
if (model.Thread.IsSpecified)
Thread = RestThreadChannel.Create(Discord, new RestGuild(Discord, model.Thread.Value.GuildId.Value), model.Thread.Value);
if (model.Call.IsSpecified)
CallData = new MessageCallData(model.Call.Value.Participants, model.Call.Value.EndedTimestamp.ToNullable());
}
/// <inheritdoc />
public async Task UpdateAsync(RequestOptions options = null)