few more async events

This commit is contained in:
Master Kwoth 2017-06-06 05:02:06 +02:00
parent 9efd41c25d
commit 0a5d9e66d6
3 changed files with 8 additions and 5 deletions

View File

@ -79,7 +79,7 @@ namespace NadekoBot.Services.Administration
if (muted == null || !muted.Contains(usr.Id)) if (muted == null || !muted.Contains(usr.Id))
return Task.CompletedTask; return Task.CompletedTask;
Task.Run(() => MuteUser(usr).ConfigureAwait(false)); var _ = Task.Run(() => MuteUser(usr).ConfigureAwait(false));
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -57,8 +57,11 @@ namespace NadekoBot.Services.Permissions
WordFilteringChannels = new ConcurrentHashSet<ulong>(gcs.SelectMany(gc => gc.FilterWordsChannelIds.Select(fwci => fwci.ChannelId))); WordFilteringChannels = new ConcurrentHashSet<ulong>(gcs.SelectMany(gc => gc.FilterWordsChannelIds.Select(fwci => fwci.ChannelId)));
_client.MessageUpdated += (oldData, newMsg, channel) _client.MessageUpdated += (oldData, newMsg, channel) =>
=> FilterInvites((channel as ITextChannel)?.Guild, newMsg as IUserMessage); {
var _ = Task.Run(() => FilterInvites((channel as ITextChannel)?.Guild, newMsg as IUserMessage));
return Task.CompletedTask;
}
} }
public async Task<bool> TryBlockEarly(IGuild guild, IUserMessage msg) public async Task<bool> TryBlockEarly(IGuild guild, IUserMessage msg)

View File

@ -120,8 +120,8 @@ namespace NadekoBot.Extensions
reactionRemoved = delegate { }; reactionRemoved = delegate { };
var wrap = new ReactionEventWrapper(client, msg); var wrap = new ReactionEventWrapper(client, msg);
wrap.OnReactionAdded += reactionAdded; wrap.OnReactionAdded += (r) => { var _ = Task.Run(() => reactionAdded(r)); };
wrap.OnReactionRemoved += reactionRemoved; wrap.OnReactionRemoved += (r) => { var _ = Task.Run(() => reactionRemoved(r)); };
return wrap; return wrap;
} }