Merge remote-tracking branch 'refs/remotes/Kwoth/1.0' into 1.0-fearnlj01
This commit is contained in:
commit
a92bdca62a
@ -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<string> 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<string> 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));
|
||||
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user