diff --git a/discord_script_standalone.py b/discord_script_standalone.py index 3a7d316..6469280 100644 --- a/discord_script_standalone.py +++ b/discord_script_standalone.py @@ -108,29 +108,11 @@ class Discord_Module(discord.Client): async def send_message(self, message: discord.Message, response): isBlocked = await self.isChannel_inConfigList(str(message.channel.id), config.block_DiscordChannelsMessaging) if self.cooldownModule.isCooldownActive("discordRateLimit") == False and not isBlocked and not config.blockAll_DiscordChannelsMessaging: - if not await self.contains_slur(response): + if not utility.contains_slur(response): await message.channel.send(response) self.cooldownModule.actionTrigger("discordRateLimit") - - # Checks for basic slurs. - async def contains_slur(self, text): - containsSlur: bool = False - parsedMessage = text.split(" ") - for word in parsedMessage: - for slur in config.slurList: - if word.lower() == slur: - containsSlur = True - break # we want to immediately escape if we found a slur - if containsSlur: - break - - if containsSlur: - print("<{ slur detected! }>") - #print("<{ slur detected! }> " + " [#" + message.channel + "](" + message.author.display_name + ") used a slur in chat") - return containsSlur - # Checks if Sender is bot. async def isSenderBot(self, message: discord.Message): isBot = False