Feature: attachment description and content type (#2180)

This commit is contained in:
Quin Lynch
2022-03-09 17:28:56 -04:00
committed by GitHub
parent 24b7bb593a
commit 765c0c5544
3 changed files with 34 additions and 2 deletions

View File

@@ -7,13 +7,29 @@ using System.Threading.Tasks;
namespace Discord
{
/// <summary>
/// Represents an outgoing file attachment used to send a file to discord.
/// </summary>
public struct FileAttachment : IDisposable
{
/// <summary>
/// Gets or sets the filename.
/// </summary>
public string FileName { get; set; }
/// <summary>
/// Gets or sets the description of the file.
/// </summary>
public string Description { get; set; }
/// <summary>
/// Gets or sets whether this file should be marked as a spoiler.
/// </summary>
public bool IsSpoiler { get; set; }
#pragma warning disable IDISP008
/// <summary>
/// Gets the stream containing the file content.
/// </summary>
public Stream Stream { get; }
#pragma warning restore IDISP008

View File

@@ -62,5 +62,13 @@ namespace Discord
/// <see langword="true"/> if the attachment is ephemeral; otherwise <see langword="false"/>.
/// </returns>
bool Ephemeral { get; }
/// <summary>
/// Gets the description of the attachment; or <see langword="null"/> if there is none set.
/// </summary>
string Description { get; }
/// <summary>
/// Gets the media's <see href="https://en.wikipedia.org/wiki/Media_type">MIME type</see> if present; otherwise <see langword="null"/>.
/// </summary>
string ContentType { get; }
}
}