Fixed !!rm spam?
This commit is contained in:
parent
517bfc2294
commit
871089bf26
@ -77,7 +77,7 @@ namespace NadekoBot.Modules.Music.Classes
|
|||||||
|
|
||||||
public string PrettyVolume => $"🔉 {(int)(Volume * 100)}%";
|
public string PrettyVolume => $"🔉 {(int)(Volume * 100)}%";
|
||||||
|
|
||||||
public event Action<Song> SongRemoved = delegate { };
|
public event Action<Song, int> SongRemoved = delegate { };
|
||||||
|
|
||||||
public MusicPlayer(IVoiceChannel startingVoiceChannel, float? defaultVolume)
|
public MusicPlayer(IVoiceChannel startingVoiceChannel, float? defaultVolume)
|
||||||
{
|
{
|
||||||
@ -282,7 +282,7 @@ namespace NadekoBot.Modules.Music.Classes
|
|||||||
var song = playlist.ElementAtOrDefault(index);
|
var song = playlist.ElementAtOrDefault(index);
|
||||||
if (playlist.Remove(song) && !silent)
|
if (playlist.Remove(song) && !silent)
|
||||||
{
|
{
|
||||||
SongRemoved(song);
|
SongRemoved(song, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -466,22 +466,6 @@ $"{("tracks".SnPl(musicPlayer.Playlist.Count))} | {(int)total.TotalHours}h {tota
|
|||||||
if (((IGuildUser)Context.User).VoiceChannel != musicPlayer.PlaybackVoiceChannel)
|
if (((IGuildUser)Context.User).VoiceChannel != musicPlayer.PlaybackVoiceChannel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
musicPlayer.SongRemoved += async (song) =>
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var embed = new EmbedBuilder()
|
|
||||||
.WithAuthor(eab => eab.WithName("Removed song #" + num).WithMusicIcon())
|
|
||||||
.WithDescription(song.PrettyName)
|
|
||||||
.WithFooter(ef => ef.WithText(song.PrettyInfo))
|
|
||||||
.WithErrorColor();
|
|
||||||
|
|
||||||
await Context.Channel.EmbedAsync(embed).ConfigureAwait(false);
|
|
||||||
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
};
|
|
||||||
|
|
||||||
musicPlayer.RemoveSongAt(num - 1);
|
musicPlayer.RemoveSongAt(num - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -868,6 +852,23 @@ $"{("tracks".SnPl(musicPlayer.Playlist.Count))} | {(int)total.TotalHours}h {tota
|
|||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
mp.SongRemoved += async (song, index) =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var embed = new EmbedBuilder()
|
||||||
|
.WithAuthor(eab => eab.WithName("Removed song #" + (index + 1)).WithMusicIcon())
|
||||||
|
.WithDescription(song.PrettyName)
|
||||||
|
.WithFooter(ef => ef.WithText(song.PrettyInfo))
|
||||||
|
.WithErrorColor();
|
||||||
|
|
||||||
|
await textCh.EmbedAsync(embed).ConfigureAwait(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
};
|
||||||
return mp;
|
return mp;
|
||||||
});
|
});
|
||||||
Song resolvedSong;
|
Song resolvedSong;
|
||||||
|
Loading…
Reference in New Issue
Block a user