mirror of
https://github.com/RPCS3/discord-bot.git
synced 2026-01-31 01:25:22 +01:00
send user dm if content filter has kicked the user
This commit is contained in:
@@ -260,9 +260,14 @@ internal static class ContentFilter
|
||||
{
|
||||
try
|
||||
{
|
||||
if (await client.GetMemberAsync(message.Channel.Guild, message.Author).ConfigureAwait(false) is DiscordMember mem
|
||||
if (await client.GetMemberAsync(message.Channel?.Guild, message.Author).ConfigureAwait(false) is DiscordMember mem
|
||||
&& !mem.Roles.Any())
|
||||
{
|
||||
try
|
||||
{
|
||||
await mem.SendMessageAsync("You have been kicked from the server for posting undesirable content. Please do not post it again.").ConfigureAwait(false);
|
||||
}
|
||||
catch {}
|
||||
await mem.RemoveAsync("Filter action for trigger " + trigger.String).ConfigureAwait(false);
|
||||
completedActions.Add(FilterAction.Kick);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user