New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Advanced channel filters #1748
Advanced channel filters #1748
Conversation
The "filter info" button will not be active until these changes are pushed to master but direct users towards docs/Filters.md.
Some compilers evaluate parameters from right to left which would lead to incorrect parsing. The parser now works correctly regardless of the compiler.
Why does this introduce a language for defining filters and not a GUI? Is this accessible to users that are not coders? |
This should be merged with Chatterino/chatterino2#1748
Quick question: Is it as simple as adding a filter with Secondly, using |
@ALazyMeme
Nevermind, I found the issue (fixed in 1025894). I don't know why I wasn't able to replicate the crash earlier. |
Will be merging this in as is once #2081 has been merged into master. Thanks a lot for your contribution! |
This is an amazing feature that makes Chatterino stand out from a lot of other chat clients. Thank you! |
Adds custom channel filters complete with their own mini-language. Filters can be created in settings, and applied by clicking the three dots to open the Split menu and selecting "Set filters".
Description
Adds custom channel filters complete with their own mini-language. Filters can be created in settings, and applied by clicking the three dots to open the Split menu and selecting "Set filters".
I tried my hand at creating an icon for the filters tab in settings, but I'd like feedback on its design.
Example filters:
message.content contains "hello"
message.length <= 40 || author.subscribed
(message.length <= 10 || message.content contains "look at this") && !(message.content contains "LULW")
Valid but useless filters:
2 + 3 == 5
10 / 2 == 3
20 % 3 == 2
Available per-message variables:
author.badges
author.color
author.name
author.subbed
author.sub_length
channel.name
channel.watching
flags.highlighted
flags.points_redeemed
flags.sub_message
flags.system_message
flags.whisper
message.content
message.length
Available operators:
&&
||
==
!=
%
<
<=
>
>=
!
contains
startswith
endswith
+
-
*
/
Literals:
123
,5
"Hello there"
,"Escaped \" quote"
Notes about the order of operations:
2 + 3 * 4
yields20
, not14
.a && b || c && d
is evaluated as(a && b) || (c && d)
a || b && c || d
is evaluated asa || (b && c) || d
Still working on:
Closes #1643
Closes #1632
Closes #518
This PR should probably be squashed into one commit