MCPcopy Create free account
hub / github.com/Botloader/botloader / from

Method from

components/runtime-models/src/discord/embed.rs:65–88  ·  view source on GitHub ↗
(v: Embed)

Source from the content-addressed store, hash-verified

63}
64impl From<Embed> for twilight_model::channel::message::embed::Embed {
65 fn from(v: Embed) -> Self {
66 Self {
67 author: v.author.map(From::from),
68 color: v.color,
69 description: v.description,
70 fields: v
71 .fields
72 .unwrap_or_default()
73 .into_iter()
74 .map(From::from)
75 .collect(),
76 footer: v.footer.map(From::from),
77 image: v.image.map(From::from),
78 kind: v.kind.unwrap_or_else(|| "rich".to_string()),
79 provider: v.provider.map(From::from),
80 thumbnail: v.thumbnail.map(From::from),
81 timestamp: v
82 .timestamp
83 .and_then(|v| Timestamp::from_micros(v.0 as i64 * 1000).ok()),
84 title: v.title,
85 url: v.url,
86 video: v.video.map(From::from),
87 }
88 }
89}
90
91impl From<twilight_model::channel::message::embed::Embed> for Embed {

Callers

nothing calls this directly

Calls 1

NotBigU64Class · 0.85

Tested by

no test coverage detected