Cog-Creators / Cog-Creators/Red-DiscordBot

Improving the filter

Open
#2,689 2 comments 0 reactions 0 assignees View on GitHub
Category: Cogs - Filter Status: Needs Discussion Type: Enhancement
Dominant language
Python
Stars
5.7k
Forks
2.5k
Avg merge
6d 16h
Merged PRs (30d)
1

Description

# Feature request

Derived from here: https://github.com/Cog-Creators/Red-DiscordBot/issues/2687

#### Select the type of feature you are requesting:

- [ ] Cog
- [x] Command
- [ ] API functionality

#### Describe your requested feature

So, regarding the recent Filter change, I believe that adding a command that would allow either inclusive phase / string filtering, or a possibility to add an own regex filter pattern (since the filtering is being done with re anyway), would massively extend the filtering possibilities to encompass this behavior.

The suggested command would be `[p]filter addi` (add inclusive) or `[p]filter addr` (add regex).

The reason behind this addition is that filtered / not allowed words often come in different formats and forms. As an example, let's consider an end user disallowing usage of the word `hack` to discourage talking about this topic on their server. To do this effectively with the current implementation, they would also have to add `hacks`, `hacking` and `hacked` as the filtered words, requiring 4 commands in total. Maintaining a filter like this becomes a huge hassle as time goes on and more words and their different forms are added, also requiring more computational power during checking. This could be easily solved by allowing the end user to specify `hack` as inclusive, filtering messages with it in every possible case.

Because inclusive filtering may also lead to false-positives (like filtering `tard` in `mustard`), I'd lean more towards implementing adding regex patterns. Filtering `hack` and it's different forms would be as easy as doing: `[p]filter addr hack(?:s|ed|ing)?`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.