#[non_exhaustive]pub struct UnfurledMediaItem {
pub url: CompactString,
pub proxy_url: Option<CompactString>,
pub height: Option<u32>,
pub width: Option<u32>,
pub placeholder: Option<CompactString>,
pub placeholder_version: Option<u32>,
pub content_type: Option<CompactString>,
pub loading_state: Option<LoadingState>,
pub flags: Option<UnfurledMediaItemFlags>,
pub content_scan_metadata: Option<ContentScanMetadata>,
pub attachment_id: Option<AttachmentId>,
}Expand description
An unfurled media item: a URL or an uploaded attachment that Discord resolves into media.
When sending, only url is used; Discord fills in the other fields in
responses.
discord.js counterpart: UnfurledMediaItem.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.url: CompactStringAny URL, or attachment://<filename> for an uploaded file.
proxy_url: Option<CompactString>The URL through Discord’s media proxy.
height: Option<u32>The height of an image or video, in pixels.
width: Option<u32>The width of an image or video, in pixels.
placeholder: Option<CompactString>A thumbhash placeholder of an image or video.
placeholder_version: Option<u32>The version of the placeholder.
content_type: Option<CompactString>The media type.
loading_state: Option<LoadingState>Whether Discord could load the media.
Undocumented: known from discord-api-types, not in the official docs; may change without notice.
flags: Option<UnfurledMediaItemFlags>The media flags.
content_scan_metadata: Option<ContentScanMetadata>The results of Discord’s content scanning, once it ran. Scanning can finish after the
message was sent; then the results arrive in a later MESSAGE_UPDATE.
attachment_id: Option<AttachmentId>The uploaded attachment, for attachment:// references.
Implementations§
Source§impl UnfurledMediaItem
impl UnfurledMediaItem
Sourcepub fn new(url: impl Into<CompactString>) -> Self
pub fn new(url: impl Into<CompactString>) -> Self
Creates a media item from a URL or attachment://<filename> reference.
discord.js counterpart: UnfurledMediaItemData.