From 1fbe7a034e888ca4a622cccc29b791f95e5bde82 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Mon, 27 Feb 2017 22:44:10 +0100 Subject: [PATCH] fixes --- src/NadekoBot/Modules/Music/Music.cs | 2 +- src/NadekoBot/Modules/Utility/Commands/MessageRepeater.cs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/NadekoBot/Modules/Music/Music.cs b/src/NadekoBot/Modules/Music/Music.cs index 5baa7c6e..02bf9993 100644 --- a/src/NadekoBot/Modules/Music/Music.cs +++ b/src/NadekoBot/Modules/Music/Music.cs @@ -690,7 +690,7 @@ namespace NadekoBot.Modules.Music return; } IUserMessage msg = null; - try { msg = await ReplyConfirmLocalized("attempting_to_queue", Format.Bold(mpl.Songs.Count.ToString())).ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); } + try { msg = await Context.Channel.SendMessageAsync(GetText("attempting_to_queue", Format.Bold(mpl.Songs.Count.ToString()))).ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); } foreach (var item in mpl.Songs) { var usr = (IGuildUser)Context.User; diff --git a/src/NadekoBot/Modules/Utility/Commands/MessageRepeater.cs b/src/NadekoBot/Modules/Utility/Commands/MessageRepeater.cs index d371330c..c615ef1e 100644 --- a/src/NadekoBot/Modules/Utility/Commands/MessageRepeater.cs +++ b/src/NadekoBot/Modules/Utility/Commands/MessageRepeater.cs @@ -44,7 +44,8 @@ namespace NadekoBot.Modules.Utility Channel = channel; Guild = NadekoBot.Client.GetGuild(repeater.GuildId); - Task.Run(Run); + if(Guild!=null) + Task.Run(Run); } @@ -127,7 +128,9 @@ namespace NadekoBot.Modules.Utility await Task.Delay(5000).ConfigureAwait(false); Repeaters = new ConcurrentDictionary>(NadekoBot.AllGuildConfigs .ToDictionary(gc => gc.GuildId, - gc => new ConcurrentQueue(gc.GuildRepeaters.Select(gr => new RepeatRunner(gr))))); + gc => new ConcurrentQueue(gc.GuildRepeaters + .Select(gr => new RepeatRunner(gr)) + .Where(x => x.Guild != null)))); _ready = true; }); }