[Feature] Voice messages support (#2665)
This commit is contained in:
@@ -24,5 +24,9 @@ namespace Discord.API
|
||||
public Optional<int> Width { get; set; }
|
||||
[JsonProperty("ephemeral")]
|
||||
public Optional<bool> Ephemeral { get; set; }
|
||||
[JsonProperty("duration_secs")]
|
||||
public Optional<double> DurationSeconds { get; set; }
|
||||
[JsonProperty("waveform")]
|
||||
public Optional<string> Waveform { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,9 +27,13 @@ namespace Discord
|
||||
public string Description { get; }
|
||||
/// <inheritdoc />
|
||||
public string ContentType { get; }
|
||||
/// <inheritdoc />
|
||||
public string Waveform { get; }
|
||||
/// <inheritdoc />
|
||||
public double? Duration { get; }
|
||||
|
||||
internal Attachment(ulong id, string filename, string url, string proxyUrl, int size, int? height, int? width,
|
||||
bool? ephemeral, string description, string contentType)
|
||||
bool? ephemeral, string description, string contentType, double? duration, string waveform)
|
||||
{
|
||||
Id = id;
|
||||
Filename = filename;
|
||||
@@ -41,6 +45,8 @@ namespace Discord
|
||||
Ephemeral = ephemeral.GetValueOrDefault(false);
|
||||
Description = description;
|
||||
ContentType = contentType;
|
||||
Duration = duration;
|
||||
Waveform = waveform;
|
||||
}
|
||||
internal static Attachment Create(Model model)
|
||||
{
|
||||
@@ -48,7 +54,9 @@ namespace Discord
|
||||
model.Height.IsSpecified ? model.Height.Value : (int?)null,
|
||||
model.Width.IsSpecified ? model.Width.Value : (int?)null,
|
||||
model.Ephemeral.ToNullable(), model.Description.GetValueOrDefault(),
|
||||
model.ContentType.GetValueOrDefault());
|
||||
model.ContentType.GetValueOrDefault(),
|
||||
model.DurationSeconds.IsSpecified ? model.DurationSeconds.Value : null,
|
||||
model.Waveform.GetValueOrDefault(null));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user