From 12feb9ee2acc59ea753a36ea128e33b1217c8449 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Mon, 14 Mar 2016 14:52:43 +0100 Subject: [PATCH] crashfix --- NadekoBot/Commands/LogCommand.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NadekoBot/Commands/LogCommand.cs b/NadekoBot/Commands/LogCommand.cs index f0da112f..cc470c66 100644 --- a/NadekoBot/Commands/LogCommand.cs +++ b/NadekoBot/Commands/LogCommand.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Concurrent; using System.Linq; +using System.Threading; using System.Timers; using System.Threading.Tasks; using Discord.Commands; @@ -24,10 +25,10 @@ namespace NadekoBot.Commands { NadekoBot.Client.MessageReceived += async (s, e) => { + if (e.Channel.IsPrivate) + return; if (!SpecificConfigurations.Default.Of(e.Server.Id).SendPrivateMessageOnMention) return; try { - if (e.Channel.IsPrivate) - return; var usr = e.Message.MentionedUsers.FirstOrDefault(u => u != e.User); if (usr?.Status != UserStatus.Offline) return; @@ -36,7 +37,6 @@ namespace NadekoBot.Commands { $"User `{e.User.Name}` mentioned you on " + $"`{e.Server.Name}` server while you were offline.\n" + $"`Message:` {e.Message.Text}"); - } catch { } }; }