From c111f4c864b6780386b2bd6abe6c7f6510f8eba2 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Fri, 28 Oct 2016 14:08:02 +0200 Subject: [PATCH] !!n can now skip multiple songs, with consequences --- src/NadekoBot/Modules/Music/Music.cs | 11 ++++++++++- src/NadekoBot/Resources/CommandStrings.Designer.cs | 4 ++-- src/NadekoBot/Resources/CommandStrings.resx | 4 ++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/NadekoBot/Modules/Music/Music.cs b/src/NadekoBot/Modules/Music/Music.cs index 70af561d..be775ab0 100644 --- a/src/NadekoBot/Modules/Music/Music.cs +++ b/src/NadekoBot/Modules/Music/Music.cs @@ -38,14 +38,23 @@ namespace NadekoBot.Modules.Music [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] - public Task Next(IUserMessage umsg) + public Task Next(IUserMessage umsg, int skipCount = 1) { var channel = (ITextChannel)umsg.Channel; + if (skipCount < 1) + return Task.CompletedTask; + MusicPlayer musicPlayer; if (!MusicPlayers.TryGetValue(channel.Guild.Id, out musicPlayer)) return Task.CompletedTask; if (musicPlayer.PlaybackVoiceChannel == ((IGuildUser)umsg.Author).VoiceChannel) + { + while (--skipCount > 0) + { + musicPlayer.RemoveSongAt(0); + } musicPlayer.Next(); + } return Task.CompletedTask; } diff --git a/src/NadekoBot/Resources/CommandStrings.Designer.cs b/src/NadekoBot/Resources/CommandStrings.Designer.cs index abb53dd0..a0eec5a2 100644 --- a/src/NadekoBot/Resources/CommandStrings.Designer.cs +++ b/src/NadekoBot/Resources/CommandStrings.Designer.cs @@ -4119,7 +4119,7 @@ namespace NadekoBot.Resources { } /// - /// Looks up a localized string similar to Goes to the next song in the queue. You have to be in the same voice channel as the bot.. + /// Looks up a localized string similar to Goes to the next song in the queue. You have to be in the same voice channel as the bot. You can skip multiple songs, but in that case songs will not be requeued if {0}rcs or {0}rpl is enabled.. /// public static string next_desc { get { @@ -4128,7 +4128,7 @@ namespace NadekoBot.Resources { } /// - /// Looks up a localized string similar to `{0}n`. + /// Looks up a localized string similar to `{0}n` or `{0}n 5`. /// public static string next_usage { get { diff --git a/src/NadekoBot/Resources/CommandStrings.resx b/src/NadekoBot/Resources/CommandStrings.resx index 99877fdd..3ef9cbb9 100644 --- a/src/NadekoBot/Resources/CommandStrings.resx +++ b/src/NadekoBot/Resources/CommandStrings.resx @@ -1426,10 +1426,10 @@ next n - Goes to the next song in the queue. You have to be in the same voice channel as the bot. + Goes to the next song in the queue. You have to be in the same voice channel as the bot. You can skip multiple songs, but in that case songs will not be requeued if {0}rcs or {0}rpl is enabled. - `{0}n` + `{0}n` or `{0}n 5` stop s