Merge remote-tracking branch 'refs/remotes/origin/dev' into music-rewrite

This commit is contained in:
Kwoth 2016-07-20 23:16:23 +02:00
commit 7567f28baa
4 changed files with 4 additions and 6 deletions

View File

@ -226,7 +226,7 @@ namespace NadekoBot.Modules.Gambling.Helpers
{ {
return kvp.Key; return kvp.Key;
} }
return "High card " + cards.Max().GetName(); return "High card " + (cards.FirstOrDefault(c => c.Number == 1)?.GetName() ?? cards.Max().GetName());
} }
} }
} }

View File

@ -27,8 +27,6 @@ namespace NadekoBot.Modules.Music.Classes
public class MusicPlayer public class MusicPlayer
{ {
public static int MaximumPlaylistSize => 50;
private IAudioClient audioClient { get; set; } private IAudioClient audioClient { get; set; }
private readonly List<Song> playlist = new List<Song>(); private readonly List<Song> playlist = new List<Song>();

View File

@ -151,7 +151,7 @@ namespace NadekoBot.Modules.Music
else if (musicPlayer.RepeatPlaylist) else if (musicPlayer.RepeatPlaylist)
toSend += "🔁"; toSend += "🔁";
toSend += $" **{musicPlayer.Playlist.Count}** `tracks currently queued. Showing page {page}` "; toSend += $" **{musicPlayer.Playlist.Count}** `tracks currently queued. Showing page {page}` ";
if (musicPlayer.Playlist.Count >= MusicPlayer.MaximumPlaylistSize) if (musicPlayer.Playlist.Count >= musicPlayer.MaxQueueSize)
toSend += "**Song queue is full!**\n"; toSend += "**Song queue is full!**\n";
else else
toSend += "\n"; toSend += "\n";

View File

@ -226,10 +226,10 @@ $@"🌍 **Weather for** 【{obj["target"]}】
.Parameter("terms", ParameterType.Unparsed) .Parameter("terms", ParameterType.Unparsed)
.Do(async e => .Do(async e =>
{ {
var terms = e.GetArg("terms")?.Trim().Replace(' ', '+'); var terms = e.GetArg("terms")?.Trim();
if (string.IsNullOrWhiteSpace(terms)) if (string.IsNullOrWhiteSpace(terms))
return; return;
await e.Channel.SendMessage($"https://google.com/search?q={ HttpUtility.UrlEncode(terms) }") await e.Channel.SendMessage($"https://google.com/search?q={ HttpUtility.UrlEncode(terms).Replace(' ', '+') }")
.ConfigureAwait(false); .ConfigureAwait(false);
}); });