!!fp added

This commit is contained in:
Kwoth
2016-12-25 06:39:04 +01:00
parent 824916a41e
commit 3526f956c3
4 changed files with 58 additions and 8 deletions

View File

@@ -34,7 +34,7 @@ namespace NadekoBot.Modules.Music.Classes
/// Player will prioritize different queuer name
/// over the song position in the playlist
/// </summary>
public bool FairPlay { get; set; } = false;
public bool FairPlay { get; set; } = true;
/// <summary>
/// Users who recently got their music wish
@@ -214,7 +214,7 @@ namespace NadekoBot.Modules.Music.Classes
}
recentlyPlayedUsers.Add(song.QueuerName);
return song ?? playlist.FirstOrDefault();
return song;
}
public void Shuffle()

View File

@@ -126,6 +126,20 @@ namespace NadekoBot.Modules.Music
return Task.CompletedTask;
}
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
public async Task Fairplay(IUserMessage umsg)
{
var channel = (ITextChannel)umsg.Channel;
MusicPlayer musicPlayer;
if (!MusicPlayers.TryGetValue(channel.Guild.Id, out musicPlayer)) return;
if (((IGuildUser)umsg.Author).VoiceChannel != musicPlayer.PlaybackVoiceChannel)
return;
var val = musicPlayer.FairPlay = !musicPlayer.FairPlay;
await channel.SendConfirmAsync("Fair play " + (val ? "enabled" : "disabled") + ".").ConfigureAwait(false);
}
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
public async Task Queue(IUserMessage umsg, [Remainder] string query)