From 943556eafc1d2a3325b9506899d9d60a2cd8eb64 Mon Sep 17 00:00:00 2001 From: ___ Date: Tue, 28 Jul 2026 11:46:48 -0700 Subject: [PATCH 1/4] feat(http, model): Add placeholder, content-type, and flags to embeds Closes #2524 This adds the optional content-type, placeholder, and media flag fields to the embed image and video structs. --- .../src/application/interaction/resolved.rs | 10 ++- twilight-model/src/channel/attachment.rs | 16 +++- .../src/channel/message/embed/image.rs | 36 +++++++- .../src/channel/message/embed/media_flags.rs | 84 +++++++++++++++++++ .../src/channel/message/embed/mod.rs | 46 ++++++++-- .../src/channel/message/embed/video.rs | 36 +++++++- .../src/channel/message/snapshot.rs | 20 ++++- twilight-util/src/builder/embed/mod.rs | 4 + 8 files changed, 241 insertions(+), 11 deletions(-) create mode 100644 twilight-model/src/channel/message/embed/media_flags.rs diff --git a/twilight-model/src/application/interaction/resolved.rs b/twilight-model/src/application/interaction/resolved.rs index b283549616..2c38b66713 100644 --- a/twilight-model/src/application/interaction/resolved.rs +++ b/twilight-model/src/application/interaction/resolved.rs @@ -146,6 +146,8 @@ mod tests { duration_secs: None, height: Some(2674), id: Id::new(400), + placeholder: Some("DCE71125807877787F888787784877788870FA3DC0".to_owned()), + placeholder_version: Some(1), proxy_url: "https://proxy.example.com/rainbow_dash.png".to_owned(), size: 13370, title: None, @@ -333,7 +335,7 @@ mod tests { Token::Str("400"), Token::Struct { name: "Attachment", - len: 9, + len: 11, }, Token::Str("content_type"), Token::Some, @@ -348,6 +350,12 @@ mod tests { Token::Str("id"), Token::NewtypeStruct { name: "Id" }, Token::Str("400"), + Token::Str("placeholder"), + Token::Some, + Token::Str("DCE71125807877787F888787784877788870FA3DC0"), + Token::Str("placeholder_version"), + Token::Some, + Token::U64(1), Token::Str("proxy_url"), Token::Str("https://proxy.example.com/rainbow_dash.png"), Token::Str("size"), diff --git a/twilight-model/src/channel/attachment.rs b/twilight-model/src/channel/attachment.rs index 901e75fdfb..787e922c79 100644 --- a/twilight-model/src/channel/attachment.rs +++ b/twilight-model/src/channel/attachment.rs @@ -30,6 +30,12 @@ pub struct Attachment { #[serde(skip_serializing_if = "Option::is_none")] pub height: Option, pub id: Id, + /// A [thumbhash](https://evanw.github.io/thumbhash) placeholder of the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub placeholder: Option, + /// Version of the placeholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub placeholder_version: Option, pub proxy_url: String, pub size: u64, /// The title of the file. @@ -83,6 +89,8 @@ mod tests { duration_secs: Some(3.2), height: Some(184), id: Id::new(700_000_000_000_000_000), + placeholder: Some("DCE71125807877787F888787784877788870FA3DC0".to_owned()), + placeholder_version: Some(1), proxy_url: "https://cdn.example.com/1.png".to_owned(), size: 13_593, title: Some("a title".to_owned()), @@ -96,7 +104,7 @@ mod tests { &[ Token::Struct { name: "Attachment", - len: 13, + len: 15, }, Token::Str("content_type"), Token::Some, @@ -118,6 +126,12 @@ mod tests { Token::Str("id"), Token::NewtypeStruct { name: "Id" }, Token::Str("700000000000000000"), + Token::Str("placeholder"), + Token::Some, + Token::Str("DCE71125807877787F888787784877788870FA3DC0"), + Token::Str("placeholder_version"), + Token::Some, + Token::U64(1), Token::Str("proxy_url"), Token::Str("https://cdn.example.com/1.png"), Token::Str("size"), diff --git a/twilight-model/src/channel/message/embed/image.rs b/twilight-model/src/channel/message/embed/image.rs index 55a77d5f38..dbaea9c02d 100644 --- a/twilight-model/src/channel/message/embed/image.rs +++ b/twilight-model/src/channel/message/embed/image.rs @@ -1,5 +1,7 @@ use serde::{Deserialize, Serialize}; +use super::EmbedMediaFlags; + #[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)] pub struct EmbedImage { #[serde(skip_serializing_if = "Option::is_none")] @@ -9,11 +11,26 @@ pub struct EmbedImage { pub url: String, #[serde(skip_serializing_if = "Option::is_none")] pub width: Option, + /// Image's [media type]. + /// + /// [media type]: https://en.wikipedia.org/wiki/Media_type + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// A [thumbhash](https://evanw.github.io/thumbhash) placeholder of the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub placeholder: Option, + /// Version of the placeholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub placeholder_version: Option, + /// Media flags for this video. + #[serde(skip_serializing_if = "Option::is_none")] + pub flags: Option, } #[cfg(test)] mod tests { use super::EmbedImage; + use super::EmbedMediaFlags; use serde_test::Token; #[test] @@ -23,6 +40,11 @@ mod tests { proxy_url: Some("https://cdn.example.com/1-hash.png".to_owned()), url: "https://example.com/1.png".to_owned(), width: Some(2560), + content_type: Some("image/png".to_owned()), + // The example value on the thumbhash website - picture of a green field. + placeholder: Some("DCE71125807877787F888787784877788870FA3DC0".to_owned()), + placeholder_version: Some(1), + flags: Some(EmbedMediaFlags::IS_ANIMATED), }; serde_test::assert_tokens( @@ -30,7 +52,7 @@ mod tests { &[ Token::Struct { name: "EmbedImage", - len: 4, + len: 8, }, Token::Str("height"), Token::Some, @@ -43,6 +65,18 @@ mod tests { Token::Str("width"), Token::Some, Token::U64(2560), + Token::Str("content_type"), + Token::Some, + Token::Str("image/png"), + Token::Str("placeholder"), + Token::Some, + Token::Str("DCE71125807877787F888787784877788870FA3DC0"), + Token::Str("placeholder_version"), + Token::Some, + Token::U64(1), + Token::Str("flags"), + Token::Some, + Token::U64(32), Token::StructEnd, ], ); diff --git a/twilight-model/src/channel/message/embed/media_flags.rs b/twilight-model/src/channel/message/embed/media_flags.rs new file mode 100644 index 0000000000..7b3f397bc3 --- /dev/null +++ b/twilight-model/src/channel/message/embed/media_flags.rs @@ -0,0 +1,84 @@ +use bitflags::bitflags; +use serde::{ + de::{Deserialize, Deserializer}, + ser::{Serialize, Serializer}, +}; + +bitflags! { + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + pub struct EmbedMediaFlags: u64 { + /// This image is animated + const IS_ANIMATED = 1 << 5; + } +} + +impl<'de> Deserialize<'de> for EmbedMediaFlags { + fn deserialize>(deserializer: D) -> Result { + Ok(Self::from_bits_truncate(u64::deserialize(deserializer)?)) + } +} + +impl Serialize for EmbedMediaFlags { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_u64(self.bits()) + } +} + +#[cfg(test)] +mod tests { + use super::EmbedMediaFlags; + use serde::{Deserialize, Serialize}; + use serde_test::Token; + use static_assertions::{assert_impl_all, const_assert_eq}; + use std::{ + fmt::{Binary, Debug, LowerHex, Octal, UpperHex}, + hash::Hash, + ops::{ + BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Not, Sub, SubAssign, + }, + }; + + assert_impl_all!( + EmbedMediaFlags: Binary, + BitAnd, + BitAndAssign, + BitOr, + BitOrAssign, + BitXor, + BitXorAssign, + Clone, + Copy, + Debug, + Deserialize<'static>, + Eq, + Extend, + FromIterator, + Hash, + LowerHex, + Not, + Octal, + PartialEq, + Send, + Serialize, + Sub, + SubAssign, + Sync, + UpperHex + ); + + const_assert_eq!(EmbedMediaFlags::IS_ANIMATED.bits(), 32); + + #[test] + fn serde() { + serde_test::assert_tokens( + &EmbedMediaFlags::IS_ANIMATED, + &[Token::U64(EmbedMediaFlags::IS_ANIMATED.bits())], + ); + + // Deserialization truncates unknown bits. + serde_test::assert_de_tokens(&EmbedMediaFlags::empty(), &[Token::U64(1 << 63)]); + } +} diff --git a/twilight-model/src/channel/message/embed/mod.rs b/twilight-model/src/channel/message/embed/mod.rs index 6b83eaf39e..9bbea6ba46 100644 --- a/twilight-model/src/channel/message/embed/mod.rs +++ b/twilight-model/src/channel/message/embed/mod.rs @@ -5,13 +5,15 @@ mod author; mod field; mod footer; mod image; +mod media_flags; mod provider; mod thumbnail; mod video; pub use self::{ author::EmbedAuthor, field::EmbedField, footer::EmbedFooter, image::EmbedImage, - provider::EmbedProvider, thumbnail::EmbedThumbnail, video::EmbedVideo, + media_flags::EmbedMediaFlags, provider::EmbedProvider, thumbnail::EmbedThumbnail, + video::EmbedVideo, }; use crate::util::Timestamp; @@ -50,8 +52,8 @@ pub struct Embed { #[cfg(test)] mod tests { use super::{ - Embed, EmbedAuthor, EmbedField, EmbedFooter, EmbedImage, EmbedProvider, EmbedThumbnail, - EmbedVideo, + Embed, EmbedAuthor, EmbedField, EmbedFooter, EmbedImage, EmbedMediaFlags, EmbedProvider, + EmbedThumbnail, EmbedVideo, }; use crate::util::datetime::{Timestamp, TimestampParseError}; use serde_test::Token; @@ -137,6 +139,11 @@ mod tests { proxy_url: Some("https://cdn.example.com/1-hash.png".to_owned()), url: "https://example.com/1.png".to_owned(), width: Some(2560), + content_type: Some("image/png".to_owned()), + // The example value on the thumbhash website - picture of a green field. + placeholder: Some("DCE71125807877787F888787784877788870FA3DC0".to_owned()), + placeholder_version: Some(1), + flags: Some(EmbedMediaFlags::IS_ANIMATED), }), kind: "rich".to_owned(), provider: Some(EmbedProvider { @@ -157,6 +164,11 @@ mod tests { proxy_url: Some("https://proxy.cdn.example.com/1-hash.mp4".to_owned()), url: Some("https://cdn.example.com/1-hash.mp4".to_owned()), width: Some(2560), + content_type: Some("video/mp4".to_owned()), + // The example value on the thumbhash website - picture of a green field. + placeholder: Some("DCE71125807877787F888787784877788870FA3DC0".to_owned()), + placeholder_version: Some(1), + flags: Some(EmbedMediaFlags::IS_ANIMATED), }), }; @@ -224,7 +236,7 @@ mod tests { Token::Some, Token::Struct { name: "EmbedImage", - len: 4, + len: 8, }, Token::Str("height"), Token::Some, @@ -237,6 +249,18 @@ mod tests { Token::Str("width"), Token::Some, Token::U64(2560), + Token::Str("content_type"), + Token::Some, + Token::Str("image/png"), + Token::Str("placeholder"), + Token::Some, + Token::Str("DCE71125807877787F888787784877788870FA3DC0"), + Token::Str("placeholder_version"), + Token::Some, + Token::U64(1), + Token::Str("flags"), + Token::Some, + Token::U64(32), Token::StructEnd, Token::Str("type"), Token::Str("rich"), @@ -284,7 +308,7 @@ mod tests { Token::Some, Token::Struct { name: "EmbedVideo", - len: 4, + len: 8, }, Token::Str("height"), Token::Some, @@ -298,6 +322,18 @@ mod tests { Token::Str("width"), Token::Some, Token::U64(2560), + Token::Str("content_type"), + Token::Some, + Token::Str("video/mp4"), + Token::Str("placeholder"), + Token::Some, + Token::Str("DCE71125807877787F888787784877788870FA3DC0"), + Token::Str("placeholder_version"), + Token::Some, + Token::U64(1), + Token::Str("flags"), + Token::Some, + Token::U64(32), Token::StructEnd, Token::StructEnd, ], diff --git a/twilight-model/src/channel/message/embed/video.rs b/twilight-model/src/channel/message/embed/video.rs index 35e6c38302..0c1fb3b45c 100644 --- a/twilight-model/src/channel/message/embed/video.rs +++ b/twilight-model/src/channel/message/embed/video.rs @@ -1,5 +1,7 @@ use serde::{Deserialize, Serialize}; +use super::EmbedMediaFlags; + #[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)] pub struct EmbedVideo { #[serde(skip_serializing_if = "Option::is_none")] @@ -10,10 +12,25 @@ pub struct EmbedVideo { pub url: Option, #[serde(skip_serializing_if = "Option::is_none")] pub width: Option, + /// Video's [media type]. + /// + /// [media type]: https://en.wikipedia.org/wiki/Media_type + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// A [thumbhash](https://evanw.github.io/thumbhash) placeholder of the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub placeholder: Option, + /// Version of the placeholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub placeholder_version: Option, + /// Media flags for this video. + #[serde(skip_serializing_if = "Option::is_none")] + pub flags: Option, } #[cfg(test)] mod tests { + use super::EmbedMediaFlags; use super::EmbedVideo; use serde_test::Token; @@ -24,6 +41,11 @@ mod tests { proxy_url: Some("https://proxy.cdn.example.com/1-hash.mp4".to_owned()), url: Some("https://cdn.example.com/1-hash.mp4".to_owned()), width: Some(2560), + content_type: Some("video/mp4".to_owned()), + // The example value on the thumbhash website - picture of a green field. + placeholder: Some("DCE71125807877787F888787784877788870FA3DC0".to_owned()), + placeholder_version: Some(1), + flags: Some(EmbedMediaFlags::IS_ANIMATED), }; serde_test::assert_tokens( @@ -31,7 +53,7 @@ mod tests { &[ Token::Struct { name: "EmbedVideo", - len: 4, + len: 8, }, Token::Str("height"), Token::Some, @@ -45,6 +67,18 @@ mod tests { Token::Str("width"), Token::Some, Token::U64(2560), + Token::Str("content_type"), + Token::Some, + Token::Str("video/mp4"), + Token::Str("placeholder"), + Token::Some, + Token::Str("DCE71125807877787F888787784877788870FA3DC0"), + Token::Str("placeholder_version"), + Token::Some, + Token::U64(1), + Token::Str("flags"), + Token::Some, + Token::U64(32), Token::StructEnd, ], ); diff --git a/twilight-model/src/channel/message/snapshot.rs b/twilight-model/src/channel/message/snapshot.rs index e35e74ff16..44a2df310e 100644 --- a/twilight-model/src/channel/message/snapshot.rs +++ b/twilight-model/src/channel/message/snapshot.rs @@ -74,6 +74,8 @@ mod tests { flags: None, height: Some(100), id: Id::new(1), + placeholder: Some("DCE71125807877787F888787784877788870FA3DC0".to_owned()), + placeholder_version: Some(1), proxy_url: "https://example.com".to_owned(), size: 1000, title: None, @@ -111,7 +113,7 @@ mod tests { Token::Seq { len: Some(1) }, Token::Struct { name: "Attachment", - len: 8, + len: 10, }, Token::Str("content_type"), Token::None, @@ -123,6 +125,12 @@ mod tests { Token::Str("id"), Token::NewtypeStruct { name: "Id" }, Token::Str("1"), + Token::Str("placeholder"), + Token::Some, + Token::Str("DCE71125807877787F888787784877788870FA3DC0"), + Token::Str("placeholder_version"), + Token::Some, + Token::U64(1), Token::Str("proxy_url"), Token::Str("https://example.com"), Token::Str("size"), @@ -170,6 +178,8 @@ mod tests { flags: None, height: Some(100), id: Id::new(1), + placeholder: Some("DCE71125807877787F888787784877788870FA3DC0".to_owned()), + placeholder_version: Some(1), proxy_url: "https://example.com".to_owned(), size: 1000, title: None, @@ -223,7 +233,7 @@ mod tests { Token::Seq { len: Some(1) }, Token::Struct { name: "Attachment", - len: 8, + len: 10, }, Token::Str("content_type"), Token::None, @@ -235,6 +245,12 @@ mod tests { Token::Str("id"), Token::NewtypeStruct { name: "Id" }, Token::Str("1"), + Token::Str("placeholder"), + Token::Some, + Token::Str("DCE71125807877787F888787784877788870FA3DC0"), + Token::Str("placeholder_version"), + Token::Some, + Token::U64(1), Token::Str("proxy_url"), Token::Str("https://example.com"), Token::Str("size"), diff --git a/twilight-util/src/builder/embed/mod.rs b/twilight-util/src/builder/embed/mod.rs index e65b9ee25a..eb1776430a 100644 --- a/twilight-util/src/builder/embed/mod.rs +++ b/twilight-util/src/builder/embed/mod.rs @@ -242,6 +242,10 @@ impl EmbedBuilder { proxy_url: None, url: image_source.0, width: None, + content_type: None, + placeholder: None, + placeholder_version: None, + flags: None, }); self From d553547cb444320fbc185028a82bc633205bdeab Mon Sep 17 00:00:00 2001 From: ___ Date: Tue, 28 Jul 2026 12:54:06 -0700 Subject: [PATCH 2/4] use project logo for example thumbhash --- twilight-model/src/application/interaction/resolved.rs | 5 +++-- twilight-model/src/channel/attachment.rs | 5 +++-- twilight-model/src/channel/message/embed/image.rs | 6 +++--- twilight-model/src/channel/message/embed/mod.rs | 8 ++++---- twilight-model/src/channel/message/embed/video.rs | 6 +++--- twilight-model/src/channel/message/snapshot.rs | 10 ++++++---- 6 files changed, 22 insertions(+), 18 deletions(-) diff --git a/twilight-model/src/application/interaction/resolved.rs b/twilight-model/src/application/interaction/resolved.rs index 2c38b66713..76b8b0f327 100644 --- a/twilight-model/src/application/interaction/resolved.rs +++ b/twilight-model/src/application/interaction/resolved.rs @@ -146,7 +146,8 @@ mod tests { duration_secs: None, height: Some(2674), id: Id::new(400), - placeholder: Some("DCE71125807877787F888787784877788870FA3DC0".to_owned()), + // Thumbhash of the twilight project logo. + placeholder: Some("zSeKDQIoCLiHeIKeiLyfrsBqCIaYaHJ2Vg".to_owned()), placeholder_version: Some(1), proxy_url: "https://proxy.example.com/rainbow_dash.png".to_owned(), size: 13370, @@ -352,7 +353,7 @@ mod tests { Token::Str("400"), Token::Str("placeholder"), Token::Some, - Token::Str("DCE71125807877787F888787784877788870FA3DC0"), + Token::Str("zSeKDQIoCLiHeIKeiLyfrsBqCIaYaHJ2Vg"), Token::Str("placeholder_version"), Token::Some, Token::U64(1), diff --git a/twilight-model/src/channel/attachment.rs b/twilight-model/src/channel/attachment.rs index 787e922c79..24fa0a5747 100644 --- a/twilight-model/src/channel/attachment.rs +++ b/twilight-model/src/channel/attachment.rs @@ -89,7 +89,8 @@ mod tests { duration_secs: Some(3.2), height: Some(184), id: Id::new(700_000_000_000_000_000), - placeholder: Some("DCE71125807877787F888787784877788870FA3DC0".to_owned()), + // Thumbhash of the twilight project logo. + placeholder: Some("zSeKDQIoCLiHeIKeiLyfrsBqCIaYaHJ2Vg".to_owned()), placeholder_version: Some(1), proxy_url: "https://cdn.example.com/1.png".to_owned(), size: 13_593, @@ -128,7 +129,7 @@ mod tests { Token::Str("700000000000000000"), Token::Str("placeholder"), Token::Some, - Token::Str("DCE71125807877787F888787784877788870FA3DC0"), + Token::Str("zSeKDQIoCLiHeIKeiLyfrsBqCIaYaHJ2Vg"), Token::Str("placeholder_version"), Token::Some, Token::U64(1), diff --git a/twilight-model/src/channel/message/embed/image.rs b/twilight-model/src/channel/message/embed/image.rs index dbaea9c02d..483936d74d 100644 --- a/twilight-model/src/channel/message/embed/image.rs +++ b/twilight-model/src/channel/message/embed/image.rs @@ -41,8 +41,8 @@ mod tests { url: "https://example.com/1.png".to_owned(), width: Some(2560), content_type: Some("image/png".to_owned()), - // The example value on the thumbhash website - picture of a green field. - placeholder: Some("DCE71125807877787F888787784877788870FA3DC0".to_owned()), + // Thumbhash of the twilight project logo. + placeholder: Some("zSeKDQIoCLiHeIKeiLyfrsBqCIaYaHJ2Vg".to_owned()), placeholder_version: Some(1), flags: Some(EmbedMediaFlags::IS_ANIMATED), }; @@ -70,7 +70,7 @@ mod tests { Token::Str("image/png"), Token::Str("placeholder"), Token::Some, - Token::Str("DCE71125807877787F888787784877788870FA3DC0"), + Token::Str("zSeKDQIoCLiHeIKeiLyfrsBqCIaYaHJ2Vg"), Token::Str("placeholder_version"), Token::Some, Token::U64(1), diff --git a/twilight-model/src/channel/message/embed/mod.rs b/twilight-model/src/channel/message/embed/mod.rs index 9bbea6ba46..a6b59c7f0b 100644 --- a/twilight-model/src/channel/message/embed/mod.rs +++ b/twilight-model/src/channel/message/embed/mod.rs @@ -140,8 +140,8 @@ mod tests { url: "https://example.com/1.png".to_owned(), width: Some(2560), content_type: Some("image/png".to_owned()), - // The example value on the thumbhash website - picture of a green field. - placeholder: Some("DCE71125807877787F888787784877788870FA3DC0".to_owned()), + // Thumbhash of the twilight project logo. + placeholder: Some("zSeKDQIoCLiHeIKeiLyfrsBqCIaYaHJ2Vg".to_owned()), placeholder_version: Some(1), flags: Some(EmbedMediaFlags::IS_ANIMATED), }), @@ -254,7 +254,7 @@ mod tests { Token::Str("image/png"), Token::Str("placeholder"), Token::Some, - Token::Str("DCE71125807877787F888787784877788870FA3DC0"), + Token::Str("zSeKDQIoCLiHeIKeiLyfrsBqCIaYaHJ2Vg"), Token::Str("placeholder_version"), Token::Some, Token::U64(1), @@ -327,7 +327,7 @@ mod tests { Token::Str("video/mp4"), Token::Str("placeholder"), Token::Some, - Token::Str("DCE71125807877787F888787784877788870FA3DC0"), + Token::Str("zSeKDQIoCLiHeIKeiLyfrsBqCIaYaHJ2Vg"), Token::Str("placeholder_version"), Token::Some, Token::U64(1), diff --git a/twilight-model/src/channel/message/embed/video.rs b/twilight-model/src/channel/message/embed/video.rs index 0c1fb3b45c..90782846e5 100644 --- a/twilight-model/src/channel/message/embed/video.rs +++ b/twilight-model/src/channel/message/embed/video.rs @@ -42,8 +42,8 @@ mod tests { url: Some("https://cdn.example.com/1-hash.mp4".to_owned()), width: Some(2560), content_type: Some("video/mp4".to_owned()), - // The example value on the thumbhash website - picture of a green field. - placeholder: Some("DCE71125807877787F888787784877788870FA3DC0".to_owned()), + // Thumbhash of the twilight project logo. + placeholder: Some("zSeKDQIoCLiHeIKeiLyfrsBqCIaYaHJ2Vg".to_owned()), placeholder_version: Some(1), flags: Some(EmbedMediaFlags::IS_ANIMATED), }; @@ -72,7 +72,7 @@ mod tests { Token::Str("video/mp4"), Token::Str("placeholder"), Token::Some, - Token::Str("DCE71125807877787F888787784877788870FA3DC0"), + Token::Str("zSeKDQIoCLiHeIKeiLyfrsBqCIaYaHJ2Vg"), Token::Str("placeholder_version"), Token::Some, Token::U64(1), diff --git a/twilight-model/src/channel/message/snapshot.rs b/twilight-model/src/channel/message/snapshot.rs index 44a2df310e..fa040ec516 100644 --- a/twilight-model/src/channel/message/snapshot.rs +++ b/twilight-model/src/channel/message/snapshot.rs @@ -74,7 +74,8 @@ mod tests { flags: None, height: Some(100), id: Id::new(1), - placeholder: Some("DCE71125807877787F888787784877788870FA3DC0".to_owned()), + // Thumbhash of the twilight project logo. + placeholder: Some("zSeKDQIoCLiHeIKeiLyfrsBqCIaYaHJ2Vg".to_owned()), placeholder_version: Some(1), proxy_url: "https://example.com".to_owned(), size: 1000, @@ -127,7 +128,7 @@ mod tests { Token::Str("1"), Token::Str("placeholder"), Token::Some, - Token::Str("DCE71125807877787F888787784877788870FA3DC0"), + Token::Str("zSeKDQIoCLiHeIKeiLyfrsBqCIaYaHJ2Vg"), Token::Str("placeholder_version"), Token::Some, Token::U64(1), @@ -178,7 +179,8 @@ mod tests { flags: None, height: Some(100), id: Id::new(1), - placeholder: Some("DCE71125807877787F888787784877788870FA3DC0".to_owned()), + // Thumbhash of the twilight project logo. + placeholder: Some("zSeKDQIoCLiHeIKeiLyfrsBqCIaYaHJ2Vg".to_owned()), placeholder_version: Some(1), proxy_url: "https://example.com".to_owned(), size: 1000, @@ -247,7 +249,7 @@ mod tests { Token::Str("1"), Token::Str("placeholder"), Token::Some, - Token::Str("DCE71125807877787F888787784877788870FA3DC0"), + Token::Str("zSeKDQIoCLiHeIKeiLyfrsBqCIaYaHJ2Vg"), Token::Str("placeholder_version"), Token::Some, Token::U64(1), From 74b7b5fb1a7c2882acf42a255cf03278b35652a9 Mon Sep 17 00:00:00 2001 From: ___ Date: Wed, 29 Jul 2026 11:48:11 -0700 Subject: [PATCH 3/4] missed one test data update --- twilight-model/src/channel/message/embed/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/twilight-model/src/channel/message/embed/mod.rs b/twilight-model/src/channel/message/embed/mod.rs index a6b59c7f0b..457fe5986a 100644 --- a/twilight-model/src/channel/message/embed/mod.rs +++ b/twilight-model/src/channel/message/embed/mod.rs @@ -165,8 +165,8 @@ mod tests { url: Some("https://cdn.example.com/1-hash.mp4".to_owned()), width: Some(2560), content_type: Some("video/mp4".to_owned()), - // The example value on the thumbhash website - picture of a green field. - placeholder: Some("DCE71125807877787F888787784877788870FA3DC0".to_owned()), + // Thumbhash of the twilight project logo. + placeholder: Some("zSeKDQIoCLiHeIKeiLyfrsBqCIaYaHJ2Vg".to_owned()), placeholder_version: Some(1), flags: Some(EmbedMediaFlags::IS_ANIMATED), }), From d3af379ad9c6662220fe644070baed64dd343767 Mon Sep 17 00:00:00 2001 From: ___ Date: Sat, 22 Aug 2026 11:00:57 -0700 Subject: [PATCH 4/4] fix clippy lint error --- twilight-http/src/routing.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twilight-http/src/routing.rs b/twilight-http/src/routing.rs index 212303a893..99ccacffdc 100644 --- a/twilight-http/src/routing.rs +++ b/twilight-http/src/routing.rs @@ -4578,6 +4578,6 @@ mod tests { #[test] fn get_skus() { let route = Route::GetSKUs { application_id: 1 }; - assert_eq!(route.to_string(), format!("applications/1/skus")); + assert_eq!(route.to_string(), "applications/1/skus".to_string()); } }