!!n can now skip multiple songs, with consequences
This commit is contained in:
parent
7606a20c7f
commit
c111f4c864
@ -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;
|
||||
}
|
||||
|
||||
|
@ -4119,7 +4119,7 @@ namespace NadekoBot.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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..
|
||||
/// </summary>
|
||||
public static string next_desc {
|
||||
get {
|
||||
@ -4128,7 +4128,7 @@ namespace NadekoBot.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to `{0}n`.
|
||||
/// Looks up a localized string similar to `{0}n` or `{0}n 5`.
|
||||
/// </summary>
|
||||
public static string next_usage {
|
||||
get {
|
||||
|
@ -1426,10 +1426,10 @@
|
||||
<value>next n</value>
|
||||
</data>
|
||||
<data name="next_desc" xml:space="preserve">
|
||||
<value>Goes to the next song in the queue. You have to be in the same voice channel as the bot.</value>
|
||||
<value>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.</value>
|
||||
</data>
|
||||
<data name="next_usage" xml:space="preserve">
|
||||
<value>`{0}n`</value>
|
||||
<value>`{0}n` or `{0}n 5`</value>
|
||||
</data>
|
||||
<data name="stop_cmd" xml:space="preserve">
|
||||
<value>stop s</value>
|
||||
|
Loading…
Reference in New Issue
Block a user