From 99e3c7695306da5392185462a8468963c5f570a5 Mon Sep 17 00:00:00 2001 From: 01Private Date: Tue, 13 Dec 2016 21:21:19 -0800 Subject: [PATCH] Embeds + Seperate the { } thingies --- src/NadekoBot/Modules/Music/Classes/Song.cs | 19 ++++++++++++------- src/NadekoBot/Modules/Music/Music.cs | 9 +++++++-- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/NadekoBot/Modules/Music/Classes/Song.cs b/src/NadekoBot/Modules/Music/Classes/Song.cs index 73a39ced..78ed4ffd 100644 --- a/src/NadekoBot/Modules/Music/Classes/Song.cs +++ b/src/NadekoBot/Modules/Music/Classes/Song.cs @@ -12,7 +12,7 @@ using System.Threading; using System.Threading.Tasks; using VideoLibrary; -namespace NadekoBot.Modules.Music.Classes +namespace NadekoBot.Modules.Music.Classes//{(SongInfo.Provider ?? "-")} { public class SongInfo { @@ -27,24 +27,29 @@ namespace NadekoBot.Modules.Music.Classes } public class Song { - public StreamState State { get; set; } public string PrettyName => - $"**【 {SongInfo.Title.TrimTo(55)} 】**`{(SongInfo.Provider ?? "-")}` `by {QueuerName}`"; + $"{SongInfo.Title.TrimTo(70)}"; public SongInfo SongInfo { get; } - public string QueuerName { get; set; } - public MusicPlayer MusicPlayer { get; set; } + + public string PrettyUser => + $"{QueuerName}"; + public string QueuerName { get; set; } + + public string PrettyProvider => + $"{(SongInfo.Provider ?? "No Provider")}"; + public StreamState State { get; set; } public string PrettyCurrentTime() { var time = TimeSpan.FromSeconds(bytesSent / 3840 / 50); - var str = $"【{(int)time.TotalMinutes}m {time.Seconds}s】**/** "; + var str = $"{(int)time.TotalMinutes}m {time.Seconds}s / "; if (TotalLength == TimeSpan.Zero) str += "**?**"; else if (TotalLength == TimeSpan.MaxValue) str += "**∞**"; else - str += $"【{(int)TotalLength.TotalMinutes}m {TotalLength.Seconds}s】"; + str += $"{(int)TotalLength.TotalMinutes}m {TotalLength.Seconds}s"; return str; } diff --git a/src/NadekoBot/Modules/Music/Music.cs b/src/NadekoBot/Modules/Music/Music.cs index 6c4bc301..a7250d80 100644 --- a/src/NadekoBot/Modules/Music/Music.cs +++ b/src/NadekoBot/Modules/Music/Music.cs @@ -184,8 +184,13 @@ namespace NadekoBot.Modules.Music { await musicPlayer.UpdateSongDurationsAsync().ConfigureAwait(false); } - await channel.SendMessageAsync($"🎵`Now Playing` {currentSong.PrettyName} " + - $"{currentSong.PrettyCurrentTime()}").ConfigureAwait(false); + var embed = new EmbedBuilder() + .WithAuthor(eab => eab.WithName("🎵 Now Playing")) + .WithTitle($"{currentSong.PrettyName}") + .WithDescription($"{currentSong.PrettyUser}") + .WithFooter(ef => ef.WithText($"{currentSong.PrettyProvider} | {currentSong.PrettyCurrentTime()}")) + .WithColor(NadekoBot.OkColor); + await channel.EmbedAsync(embed.Build()).ConfigureAwait(false); } [NadekoCommand, Usage, Description, Aliases]