!!lq now shows 'now playing' song
This commit is contained in:
parent
416f384bba
commit
7da3133117
@ -67,9 +67,9 @@ namespace NadekoBot.Modules.Administration
|
||||
|
||||
public static Dictionary<string, Func<string>> PlayingPlaceholders { get; } =
|
||||
new Dictionary<string, Func<string>> {
|
||||
{"%servers%", () => NadekoBot.Client.GetGuildCount().ToString()},
|
||||
{"%users%", () => NadekoBot.Client.GetGuilds().Sum(s => s.Users.Count).ToString()},
|
||||
{"%playing%", () => {
|
||||
{ "%servers%", () => NadekoBot.Client.GetGuildCount().ToString()},
|
||||
{ "%users%", () => NadekoBot.Client.GetGuilds().Sum(s => s.Users.Count).ToString()},
|
||||
{ "%playing%", () => {
|
||||
var cnt = Music.Music.MusicPlayers.Count(kvp => kvp.Value.CurrentSong != null);
|
||||
if (cnt != 1) return cnt.ToString();
|
||||
try {
|
||||
@ -81,8 +81,8 @@ namespace NadekoBot.Modules.Administration
|
||||
}
|
||||
}
|
||||
},
|
||||
{"%queued%", () => Music.Music.MusicPlayers.Sum(kvp => kvp.Value.Playlist.Count).ToString()},
|
||||
{ "%time%", () => DateTime.Now.ToString("hh:mm "+TimeZoneInfo.Local.StandardName.GetInitials()) }
|
||||
{ "%queued%", () => Music.Music.MusicPlayers.Sum(kvp => kvp.Value.Playlist.Count).ToString()},
|
||||
{ "%time%", () => DateTime.Now.ToString("hh:mm " + TimeZoneInfo.Local.StandardName.GetInitials()) }
|
||||
};
|
||||
|
||||
[NadekoCommand, Usage, Description, Aliases]
|
||||
|
@ -211,30 +211,30 @@ namespace NadekoBot.Modules.Music
|
||||
{
|
||||
int startAt = itemsPerPage * (curPage - 1);
|
||||
var number = 0 + startAt;
|
||||
var desc = string.Join("\n", musicPlayer.Playlist
|
||||
.Skip(startAt)
|
||||
.Take(itemsPerPage)
|
||||
.Select(v => $"`{++number}.` {v.PrettyFullName}"));
|
||||
|
||||
if (currentSong != null)
|
||||
desc = $"`🔊` {currentSong.PrettyFullName}\n\n" + desc;
|
||||
|
||||
if (musicPlayer.RepeatSong)
|
||||
desc = "🔂 Repeating Current Song\n\n" + desc;
|
||||
else if (musicPlayer.RepeatPlaylist)
|
||||
desc = "🔁 Repeating Playlist\n\n" + desc;
|
||||
|
||||
|
||||
|
||||
var embed = new EmbedBuilder()
|
||||
.WithAuthor(eab => eab.WithName($"Player Queue - Page {curPage}/{lastPage + 1}")
|
||||
.WithMusicIcon())
|
||||
.WithDescription(string.Join("\n", musicPlayer.Playlist
|
||||
.Skip(startAt)
|
||||
.Take(itemsPerPage)
|
||||
.Select(v => $"`{++number}.` {v.PrettyFullName}")))
|
||||
.WithDescription(desc)
|
||||
.WithFooter(ef => ef.WithText($"{musicPlayer.PrettyVolume} | {musicPlayer.Playlist.Count} " +
|
||||
$"{("tracks".SnPl(musicPlayer.Playlist.Count))} | {totalStr} | " +
|
||||
(musicPlayer.FairPlay ? "✔️fairplay" : "✖️fairplay") + $" | " + (maxPlaytime == 0 ? "unlimited" : $"{maxPlaytime}s limit")))
|
||||
.WithOkColor();
|
||||
|
||||
if (musicPlayer.RepeatSong)
|
||||
{
|
||||
embed.WithTitle($"🔂 Repeating Song: {currentSong.SongInfo.Title} | {currentSong.PrettyFullTime}");
|
||||
}
|
||||
else if (musicPlayer.RepeatPlaylist)
|
||||
{
|
||||
embed.WithTitle("🔁 Repeating Playlist");
|
||||
}
|
||||
if (musicPlayer.MaxQueueSize != 0 && musicPlayer.Playlist.Count >= musicPlayer.MaxQueueSize)
|
||||
{
|
||||
embed.WithTitle("🎵 Song queue is full!");
|
||||
}
|
||||
return embed;
|
||||
};
|
||||
await Context.Channel.SendPaginatedConfirmAsync(page, printAction, lastPage, false).ConfigureAwait(false);
|
||||
|
Loading…
Reference in New Issue
Block a user