word and invite filtering work on edited messages too, now
This commit is contained in:
parent
d5987f3331
commit
ffdfd0e84e
@ -90,6 +90,27 @@ namespace NadekoBot.Services
|
|||||||
});
|
});
|
||||||
|
|
||||||
_client.MessageReceived += MessageReceivedHandler;
|
_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;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user