File tree Expand file tree Collapse file tree
src/App/Modules/ShareMusicCommandModule Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,12 +83,7 @@ await FollowupAsync(
8383
8484 var linksComponentBuilder = GenerateMusicShareComponent ( musicEntityItem ) ;
8585
86- var messageEmbed = new EmbedBuilder ( )
87- . WithTitle ( streamingEntityItem . Title )
88- . WithDescription ( $ "by { streamingEntityItem . ArtistName } ")
89- . WithColor ( Color . DarkBlue )
90- . WithImageUrl ( $ "attachment://{ streamingEntityItem . Title } .jpg")
91- . WithFooter ( "(Powered by Songlink/Odesli)" ) ;
86+ var messageEmbed = GenerateEmbedBuilder ( streamingEntityItem ) ;
9287
9388 await Context . Channel . SendFileAsync (
9489 embed : messageEmbed . Build ( ) ,
Original file line number Diff line number Diff line change @@ -70,21 +70,16 @@ await FollowupAsync(
7070 }
7171
7272 StreamingEntityItem streamingEntityItem = musicEntityItem . EntitiesByUniqueId ! [ platformEntityLink . EntityUniqueId ! ] ;
73- using var albumArtStream = await GetAlbumArtStreamAsync ( streamingEntityItem ) ;
73+ await using var albumArtStream = await GetAlbumArtStreamAsync ( streamingEntityItem ) ;
7474
7575 var linksComponentBuilder = GenerateMusicShareComponent ( musicEntityItem ) ;
7676
77- var messageEmbed = new EmbedBuilder ( )
78- . WithTitle ( streamingEntityItem . Title )
79- . WithDescription ( $ "by { streamingEntityItem . ArtistName } ")
80- . WithColor ( Color . DarkBlue )
81- . WithImageUrl ( $ "attachment://{ streamingEntityItem . Title } .jpg")
82- . WithFooter ( "(Powered by Songlink/Odesli)" ) ;
77+ var messageEmbed = GenerateEmbedBuilder ( streamingEntityItem ) ;
8378
8479 await FollowupWithFileAsync (
8580 embed : messageEmbed . Build ( ) ,
8681 fileStream : albumArtStream ,
87- fileName : $ "{ streamingEntityItem . Title } .jpg",
82+ fileName : $ "{ streamingEntityItem . Id } .jpg",
8883 components : linksComponentBuilder . Build ( )
8984 ) ;
9085
Original file line number Diff line number Diff line change 1+ using Discord ;
2+ using MuzakBot . App . Models . Odesli ;
3+
4+ namespace MuzakBot . App . Modules ;
5+
6+ public partial class ShareMusicCommandModule
7+ {
8+ private EmbedBuilder GenerateEmbedBuilder ( StreamingEntityItem streamingEntityItem )
9+ {
10+ return new EmbedBuilder ( )
11+ . WithTitle ( streamingEntityItem . Title )
12+ . WithDescription ( $ "by { streamingEntityItem . ArtistName } ")
13+ . WithColor ( Color . DarkBlue )
14+ . WithImageUrl ( $ "attachment://{ streamingEntityItem . Id } .jpg")
15+ . WithFooter ( "(Powered by Songlink/Odesli)" ) ;
16+ }
17+ }
You can’t perform that action at this time.
0 commit comments