diff --git a/src/NadekoBot/Modules/Music/Classes/MusicControls.cs b/src/NadekoBot/Modules/Music/Classes/MusicControls.cs index be726c84..1e822f0a 100644 --- a/src/NadekoBot/Modules/Music/Classes/MusicControls.cs +++ b/src/NadekoBot/Modules/Music/Classes/MusicControls.cs @@ -77,7 +77,7 @@ namespace NadekoBot.Modules.Music.Classes public string PrettyVolume => $"🔉 {(int)(Volume * 100)}%"; - public event Action SongRemoved = delegate { }; + public event Action SongRemoved = delegate { }; public MusicPlayer(IVoiceChannel startingVoiceChannel, float? defaultVolume) { @@ -282,7 +282,7 @@ namespace NadekoBot.Modules.Music.Classes var song = playlist.ElementAtOrDefault(index); if (playlist.Remove(song) && !silent) { - SongRemoved(song); + SongRemoved(song, index); } }); diff --git a/src/NadekoBot/Modules/Music/Music.cs b/src/NadekoBot/Modules/Music/Music.cs index 9751c938..536a00ae 100644 --- a/src/NadekoBot/Modules/Music/Music.cs +++ b/src/NadekoBot/Modules/Music/Music.cs @@ -99,16 +99,16 @@ namespace NadekoBot.Modules.Music [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] - public async Task Destroy() + public Task Destroy() { - //await Context.Channel.SendErrorAsync("This command is temporarily disabled.").ConfigureAwait(false); - 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 (MusicPlayers.TryRemove(Context.Guild.Id, out musicPlayer)) musicPlayer.Destroy(); + return Task.CompletedTask; + } [NadekoCommand, Usage, Description, Aliases] @@ -458,31 +458,16 @@ $"{("tracks".SnPl(musicPlayer.Playlist.Count))} | {(int)total.TotalHours}h {tota [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] [Priority(0)] - public async Task Remove(int num) + public Task Remove(int num) { MusicPlayer musicPlayer; if (!MusicPlayers.TryGetValue(Context.Guild.Id, out musicPlayer)) - return; + return Task.CompletedTask; if (((IGuildUser)Context.User).VoiceChannel != musicPlayer.PlaybackVoiceChannel) - 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 { } - }; + return Task.CompletedTask; musicPlayer.RemoveSongAt(num - 1); + return Task.CompletedTask; } [NadekoCommand, Usage, Description, Aliases] @@ -490,8 +475,6 @@ $"{("tracks".SnPl(musicPlayer.Playlist.Count))} | {(int)total.TotalHours}h {tota [Priority(1)] public async Task Remove(string all) { - - if (all.Trim().ToUpperInvariant() != "ALL") return; MusicPlayer musicPlayer; @@ -868,6 +851,23 @@ $"{("tracks".SnPl(musicPlayer.Playlist.Count))} | {(int)total.TotalHours}h {tota } 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; }); Song resolvedSong; diff --git a/src/NadekoBot/Modules/Utility/Utility.cs b/src/NadekoBot/Modules/Utility/Utility.cs index 3abf4e04..eb7c7404 100644 --- a/src/NadekoBot/Modules/Utility/Utility.cs +++ b/src/NadekoBot/Modules/Utility/Utility.cs @@ -28,7 +28,7 @@ namespace NadekoBot.Modules.Utility { var channel = (ITextChannel)Context.Channel; - if (timeout < 0 || timeout > 3600) + if ((timeout < 60 && timeout != 0) || timeout > 3600) return; Timer t; diff --git a/src/NadekoBot/Resources/CommandStrings.Designer.cs b/src/NadekoBot/Resources/CommandStrings.Designer.cs index 17754f51..950eeaad 100644 --- a/src/NadekoBot/Resources/CommandStrings.Designer.cs +++ b/src/NadekoBot/Resources/CommandStrings.Designer.cs @@ -6063,7 +6063,7 @@ namespace NadekoBot.Resources { } /// - /// Looks up a localized string similar to Rotates a roles color on an interval with a list of supplied colors. First argument is interval in seconds. Second argument is a role, followed by a space-separated list of colors in hex. Provide a rolename with a 0 interval to disable.. + /// Looks up a localized string similar to Rotates a roles color on an interval with a list of supplied colors. First argument is interval in seconds (Minimum 60). Second argument is a role, followed by a space-separated list of colors in hex. Provide a rolename with a 0 interval to disable.. /// public static string rotaterolecolor_desc { get { @@ -6072,7 +6072,7 @@ namespace NadekoBot.Resources { } /// - /// Looks up a localized string similar to `{0}rrc 1 MyLsdRole #ff0000 #00ff00 #0000ff` or `{0}rrc 0 MyLsdRole`. + /// Looks up a localized string similar to `{0}rrc 60 MyLsdRole #ff0000 #00ff00 #0000ff` or `{0}rrc 0 MyLsdRole`. /// public static string rotaterolecolor_usage { get { diff --git a/src/NadekoBot/Resources/CommandStrings.resx b/src/NadekoBot/Resources/CommandStrings.resx index c6e2bd15..c540455d 100644 --- a/src/NadekoBot/Resources/CommandStrings.resx +++ b/src/NadekoBot/Resources/CommandStrings.resx @@ -2866,9 +2866,9 @@ rotaterolecolor rrc - Rotates a roles color on an interval with a list of supplied colors. First argument is interval in seconds. Second argument is a role, followed by a space-separated list of colors in hex. Provide a rolename with a 0 interval to disable. + Rotates a roles color on an interval with a list of supplied colors. First argument is interval in seconds (Minimum 60). Second argument is a role, followed by a space-separated list of colors in hex. Provide a rolename with a 0 interval to disable. - `{0}rrc 1 MyLsdRole #ff0000 #00ff00 #0000ff` or `{0}rrc 0 MyLsdRole` + `{0}rrc 60 MyLsdRole #ff0000 #00ff00 #0000ff` or `{0}rrc 0 MyLsdRole` \ No newline at end of file diff --git a/src/NadekoBot/ShardedDiscordClient.cs b/src/NadekoBot/ShardedDiscordClient.cs index 259fe88f..c2300bd0 100644 --- a/src/NadekoBot/ShardedDiscordClient.cs +++ b/src/NadekoBot/ShardedDiscordClient.cs @@ -80,7 +80,8 @@ namespace NadekoBot private Task Client_Log(LogMessage arg) { - _log.Warn(arg.Exception, arg.Message); + _log.Warn(arg.Message); + _log.Error(arg.Exception); return Task.CompletedTask; }