Closed aahnik closed 3 years ago
What is the problem? There is no problem. I tested with the latest version of tgcf, and it works perfectly fine.
You must write those words under quotes.
Suppose you want to blacklist messages that contain the specific words #tag
and @word
.
Then in your configuration
plugins:
filter:
text:
blacklist:
- "#tag"
- "@word"
If you want to blacklist messages that contain any word starting with #
or @
then you can use the power to regex.
The expression for that is
\s+(@\w+)\s*
, replace@
with#
incase of#
plugins:
filter:
text:
regex: true
blacklist:
- "\\s+(#\\w+)\\s*" # matches any word starting with a hashtag symbol
- "\\s+(@\\w+)\\s*" # matches any word starting with the at-the-rate symbol
Note The double slashes are for escaping the first slash in yaml
The above regex pattern has a limitation. It Will does not apply if the first word starts with @
or #
. If you try and think, you can come up with a better regex pattern.
Yes. when someone wants to omit "@someid" the program run in to error.
Originally posted by @ehs4nm in https://github.com/aahnik/tgcf/issues/93#issuecomment-835210840