Fixed music WARNINGS, not ERRORS - WARNINGS
This commit is contained in:
parent
871089bf26
commit
22bad86d37
@ -99,16 +99,16 @@ namespace NadekoBot.Modules.Music
|
|||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
public async Task Destroy()
|
public Task Destroy()
|
||||||
{
|
{
|
||||||
//await Context.Channel.SendErrorAsync("This command is temporarily disabled.").ConfigureAwait(false);
|
|
||||||
|
|
||||||
MusicPlayer musicPlayer;
|
MusicPlayer musicPlayer;
|
||||||
if (!MusicPlayers.TryGetValue(Context.Guild.Id, out musicPlayer)) return;
|
if (!MusicPlayers.TryGetValue(Context.Guild.Id, out musicPlayer)) return Task.CompletedTask;
|
||||||
if (((IGuildUser)Context.User).VoiceChannel == musicPlayer.PlaybackVoiceChannel)
|
if (((IGuildUser)Context.User).VoiceChannel == musicPlayer.PlaybackVoiceChannel)
|
||||||
if (MusicPlayers.TryRemove(Context.Guild.Id, out musicPlayer))
|
if (MusicPlayers.TryRemove(Context.Guild.Id, out musicPlayer))
|
||||||
musicPlayer.Destroy();
|
musicPlayer.Destroy();
|
||||||
|
|
||||||
|
return Task.CompletedTask;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
@ -458,15 +458,16 @@ $"{("tracks".SnPl(musicPlayer.Playlist.Count))} | {(int)total.TotalHours}h {tota
|
|||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[Priority(0)]
|
[Priority(0)]
|
||||||
public async Task Remove(int num)
|
public Task Remove(int num)
|
||||||
{
|
{
|
||||||
MusicPlayer musicPlayer;
|
MusicPlayer musicPlayer;
|
||||||
if (!MusicPlayers.TryGetValue(Context.Guild.Id, out musicPlayer))
|
if (!MusicPlayers.TryGetValue(Context.Guild.Id, out musicPlayer))
|
||||||
return;
|
return Task.CompletedTask;
|
||||||
if (((IGuildUser)Context.User).VoiceChannel != musicPlayer.PlaybackVoiceChannel)
|
if (((IGuildUser)Context.User).VoiceChannel != musicPlayer.PlaybackVoiceChannel)
|
||||||
return;
|
return Task.CompletedTask;
|
||||||
|
|
||||||
musicPlayer.RemoveSongAt(num - 1);
|
musicPlayer.RemoveSongAt(num - 1);
|
||||||
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
@ -474,8 +475,6 @@ $"{("tracks".SnPl(musicPlayer.Playlist.Count))} | {(int)total.TotalHours}h {tota
|
|||||||
[Priority(1)]
|
[Priority(1)]
|
||||||
public async Task Remove(string all)
|
public async Task Remove(string all)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if (all.Trim().ToUpperInvariant() != "ALL")
|
if (all.Trim().ToUpperInvariant() != "ALL")
|
||||||
return;
|
return;
|
||||||
MusicPlayer musicPlayer;
|
MusicPlayer musicPlayer;
|
||||||
|
Loading…
Reference in New Issue
Block a user