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))
return Task.CompletedTask;
Task.Run(() => MuteUser(usr).ConfigureAwait(false));
var _ = Task.Run(() => MuteUser(usr).ConfigureAwait(false));
}
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)));
_client.MessageUpdated += (oldData, newMsg, channel)
=> FilterInvites((channel as ITextChannel)?.Guild, newMsg as IUserMessage);
_client.MessageUpdated += (oldData, newMsg, channel) =>
{
var _ = Task.Run(() => FilterInvites((channel as ITextChannel)?.Guild, newMsg as IUserMessage));
return Task.CompletedTask;
}
}
public async Task<bool> TryBlockEarly(IGuild guild, IUserMessage msg)

View File

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