[Feature] Add MessageCallData (#2934)
This commit is contained in:
@@ -104,4 +104,7 @@ internal class Message
|
||||
|
||||
[JsonProperty("poll")]
|
||||
public Optional<Poll> Poll { get; set; }
|
||||
|
||||
[JsonProperty("call")]
|
||||
public Optional<MessageCallData> Call { get; set; }
|
||||
}
|
||||
|
||||
13
src/Discord.Net.Rest/API/Common/MessageCallData.cs
Normal file
13
src/Discord.Net.Rest/API/Common/MessageCallData.cs
Normal 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; }
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user