Skip to content
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

Suggestion - Add an advanced option for chat command hide functionality #69

Open
Nahalyd opened this issue Mar 29, 2024 · 1 comment
Open

Comments

@Nahalyd
Copy link

Nahalyd commented Mar 29, 2024

Context:

  • Some users use command with text after to troll the streamer
  • If the streamer has set a command block rule, all messages starting with the command text will be hidden.

Suggestion:

  • An option to precise if the streamer wants to hide all messages, or only those starting and ending by the command text, would be the solution
  • Technically, it should be a condition to add a regular expression anchor ($) at the end of the filtered text.
  • For the implementation, with the current UI, you could simply permit to type "$" after the command text to block, in order to enable the option. (not perfect but efficient)

Edit: typo

@Durss
Copy link
Owner

Durss commented Jun 27, 2024

Hello !

First of all, sorry for very late answer.

The possibility to filter by regexp wouldn't be technically complicated but may have bad impacts on performances :/
There are lots of tests to define wether a message should be displayed on a column or not and a regex is ~20 times slower than the current indexOf solution.

str.indexOf("!") //~1ms for 1 000 000 execs
/!\S+/g.test(str) //~20-25ms for 1 000 000 execs

Now, even if it's comparatively slower, it actually remains very low numbers so switching for regexp probably wouldn't be so bad for performances.
I'd just need to make sure users don't input massive regexp that would really kill performances.

I'll try to see if I make this possible vor v13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants