| 63 | } |
| 64 | impl 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 | |
| 91 | impl From<twilight_model::channel::message::embed::Embed> for Embed { |