using System.IO; namespace Discord { /// /// An image that will be uploaded to Discord. /// public struct Image { public Stream Stream { get; } public ImageFormat Format { get; } /// /// Create the image with a Stream. /// /// This must be some type of stream with the contents of a file in it. public Image(Stream stream, ImageFormat format = ImageFormat.Jpeg) { Stream = stream; Format = format; } #if FILESYSTEM /// /// Create the image from a file path. /// /// /// This file path is NOT validated, and is passed directly into a /// /// The path to the file. public Image(string path, ImageFormat format = ImageFormat.Jpeg) { Stream = File.OpenRead(path); Format = format; } #endif } }