diff --git a/src/NadekoBot/Modules/Administration/Commands/LogCommand.cs b/src/NadekoBot/Modules/Administration/Commands/LogCommand.cs index e291522d..1ee43243 100644 --- a/src/NadekoBot/Modules/Administration/Commands/LogCommand.cs +++ b/src/NadekoBot/Modules/Administration/Commands/LogCommand.cs @@ -48,15 +48,21 @@ namespace NadekoBot.Modules.Administration t = new Timer(async (state) => { - var keys = UserPresenceUpdates.Keys.ToList(); - - await Task.WhenAll(keys.Select(key => + try { - List messages; - if (UserPresenceUpdates.TryRemove(key, out messages)) - try { return key.SendMessageAsync(string.Join(Environment.NewLine, messages)); } catch { } //502/403 - return Task.CompletedTask; - })); + var keys = UserPresenceUpdates.Keys.ToList(); + + await Task.WhenAll(keys.Select(async key => + { + List messages; + if (UserPresenceUpdates.TryRemove(key, out messages)) + try { await key.SendMessageAsync(string.Join(Environment.NewLine, messages)); } catch { } + })); + } + catch (Exception ex) + { + _log.Warn(ex); + } }, null, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10)); diff --git a/src/NadekoBot/Modules/Games/Commands/PollCommands.cs b/src/NadekoBot/Modules/Games/Commands/PollCommands.cs index 48cfde10..b0a3ca6d 100644 --- a/src/NadekoBot/Modules/Games/Commands/PollCommands.cs +++ b/src/NadekoBot/Modules/Games/Commands/PollCommands.cs @@ -102,7 +102,7 @@ namespace NadekoBot.Modules.Games { var results = participants.GroupBy(kvp => kvp.Value) .ToDictionary(x => x.Key, x => x.Sum(kvp => 1)) - .OrderBy(kvp => kvp.Value); + .OrderByDescending(kvp => kvp.Value); var totalVotesCast = results.Sum(kvp => kvp.Value); if (totalVotesCast == 0)