This commit is contained in:
Kwoth 2016-12-14 17:05:49 +01:00
commit 6b56f0dbc3
2 changed files with 19 additions and 9 deletions

View File

@ -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 MusicPlayer MusicPlayer { get; set; }
public string PrettyUser =>
$"{QueuerName}";
public string QueuerName { get; set; }
public MusicPlayer MusicPlayer { 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;
}

View File

@ -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]