A decentralized music tracking and discovery platform built on AT Protocol 🎵 rocksky.app
spotify atproto lastfm musicbrainz scrobbling listenbrainz

feat: enhance Discord embed with user avatar and author details #2

merged opened by tsiry-sandratraina.com targeting main from feat/discord-embed
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:7vdlgi2bflelz7mmuxoqjfcr/sh.tangled.repo.pull/3lzixazq5fe22
+16 -1
Diff #0
+1
crates/jetstream/src/repo.rs
··· 116 did: did.to_string(), 117 display_name: users[0].display_name.clone(), 118 handle: users[0].handle.clone(), 119 }, 120 track: discord::model::Track { 121 title: scrobble_record.title.clone(),
··· 116 did: did.to_string(), 117 display_name: users[0].display_name.clone(), 118 handle: users[0].handle.clone(), 119 + avatar_url: users[0].avatar.clone(), 120 }, 121 track: discord::model::Track { 122 title: scrobble_record.title.clone(),
+6 -1
crates/jetstream/src/webhook/discord/mod.rs
··· 10 desc.push_str(&format!("\non *{}*", esc(&s.track.album))); 11 12 DiscordEmbed { 13 - title: s.user.display_name.clone(), 14 url, 15 description: Some(desc), 16 timestamp: Some(s.played_at.clone()), ··· 18 footer: Some(DiscordFooter { 19 text: format!("Rocksky • {}", s.user.handle.clone()), 20 }), 21 } 22 } 23
··· 10 desc.push_str(&format!("\non *{}*", esc(&s.track.album))); 11 12 DiscordEmbed { 13 + title: String::new(), 14 url, 15 description: Some(desc), 16 timestamp: Some(s.played_at.clone()), ··· 18 footer: Some(DiscordFooter { 19 text: format!("Rocksky • {}", s.user.handle.clone()), 20 }), 21 + author: DiscordAuthor { 22 + name: s.user.display_name.clone(), 23 + url: format!("https://rocksky.app/profile/{}", s.user.handle), 24 + icon_url: s.user.avatar_url.clone(), 25 + }, 26 } 27 } 28
+9
crates/jetstream/src/webhook/discord/model.rs
··· 22 pub did: String, 23 pub display_name: String, 24 pub handle: String, 25 } 26 27 #[derive(Debug, Deserialize, Serialize, Clone)] ··· 62 pub thumbnail: Option<DiscordThumb>, 63 #[serde(skip_serializing_if = "Option::is_none")] 64 pub footer: Option<DiscordFooter>, 65 } 66 67 #[derive(Debug, Serialize)]
··· 22 pub did: String, 23 pub display_name: String, 24 pub handle: String, 25 + pub avatar_url: String, 26 } 27 28 #[derive(Debug, Deserialize, Serialize, Clone)] ··· 63 pub thumbnail: Option<DiscordThumb>, 64 #[serde(skip_serializing_if = "Option::is_none")] 65 pub footer: Option<DiscordFooter>, 66 + pub author: DiscordAuthor, 67 + } 68 + 69 + #[derive(Debug, Serialize)] 70 + pub struct DiscordAuthor { 71 + pub name: String, 72 + pub url: String, 73 + pub icon_url: String, 74 } 75 76 #[derive(Debug, Serialize)]

History

1 round 0 comments
sign up or login to add to the discussion
1 commit
expand
feat: enhance Discord embed with user avatar and author details
expand 0 comments
pull request successfully merged