thedevs-network / the-guard-bot

The Guard, a Telegram bot to moderate groups.
https://t.me/thedevs_bot
GNU Affero General Public License v3.0
491 stars 162 forks source link

[Suggestion] Custom filters? #120

Closed ajhalili2006 closed 4 years ago

ajhalili2006 commented 4 years ago

While most people who remix the Guard's code will probably hard-coded their custom filters (some may add regex) to their codebase to cater to their needs.

Can we add custom filters (with regex support) to the bot features?

How managing custom filters looks like without editing the code

Adding usual filters

Adding with regex

Nuking a filter from DB

wojpawlik commented 4 years ago

Performance concern: adding too many1 unoptimized2 regexps.

  1. Current custom commands only run 1 simple regex per message. This feature would require to either check each regex against every message, or to combine them all into single complex regex.
  2. Measuring performance of each regex is out of scope of this project.

I'm open to extending custom commands, but not like this.