From 6d726b237d7c3004e726fe65263fac88854e0f30 Mon Sep 17 00:00:00 2001 From: snipe <72265661+notsniped@users.noreply.github.com> Date: Wed, 17 Apr 2024 19:19:54 +0530 Subject: [PATCH] Automatically disregard swear-filter for all NSFW channels Let's be real here, who wants a swear-filter in an NSFW channel? --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index e997420..140f635 100644 --- a/main.py +++ b/main.py @@ -195,7 +195,7 @@ async def on_message(ctx): # Swear-Filter automod_config = automod.fetch_config(ctx.guild.id) - if automod_config["swear_filter"]["enabled"] is True: + if (automod_config["swear_filter"]["enabled"] is True) and (not ctx.channel.is_nsfw()): if (automod_config["swear_filter"]["keywords"]["use_default"] and any(x in ctx.content.lower() for x in automod_config["swear_filter"]["keywords"]["default"])) or (automod_config["swear_filter"]["keywords"]["custom"] != [] and any(x in ctx.content.lower() for x in automod_config["swear_filter"]["keywords"]["custom"])): await ctx.delete() await ctx.channel.send(f'{ctx.author.mention} watch your language.', delete_after=5)