word and invite filtering work on edited messages too, now

This commit is contained in:
Kwoth 2017-02-17 15:20:28 +01:00
parent d5987f3331
commit ffdfd0e84e

View File

@ -90,6 +90,27 @@ namespace NadekoBot.Services
});
_client.MessageReceived += MessageReceivedHandler;
_client.MessageUpdated += (oldmsg, newMsg) =>
{
var ignore = Task.Run(async () =>
{
try
{
var usrMsg = newMsg as SocketUserMessage;
var guild = (usrMsg?.Channel as ITextChannel)?.Guild;
if (guild != null && !await InviteFiltered(guild, usrMsg).ConfigureAwait(false))
await WordFiltered(guild, usrMsg).ConfigureAwait(false);
}
catch (Exception ex)
{
_log.Warn(ex);
}
return Task.CompletedTask;
});
return Task.CompletedTask;
};
return Task.CompletedTask;
}