Facepunch / sbox-issues

175 stars 12 forks source link

[Discord] AutoMod Hyperlink Rule has too many false positives #6464

Closed yuberee closed 1 month ago

yuberee commented 1 month ago

For?

Other

What can't you do?

The current block rule set up to fight against hyperlinks Ex: [Google](https://www.google.com) is set up to block anything containing square and rounded brackets in that order. Most times when someone is posting an error they received to ask for help, their message gets blocked.

This happens because some errors (Especially LinQ errors) are logged in a similar way to the hyperlink markdown. Ex: System.Linq.Enumerable.Count[TSource](IEnumeralbe1 source, Func2 predicate) at Editor.GameObjectNode.<>c.b__21_3(PrefabFile x)

How would you like it to work?

Since the hyperlink markdown shows up only when using it with a full url, the block rule regex can be set up to only block messages formatted this way: [*](http*.)

Here's what the regex looks like: \[[^\]]+\]\(\s*(?:https?|ftp):\/\/[^\s\)]+\s*\)

image

  1. Server Settings
  2. Safety Setup
  3. AutoMod
  4. Find the current Hyperlink rule
  5. Replace old regex with the one above

What have you tried?

Since the block rule was added, people had to either paste a screenshot of the error or painfully replace square brackets with round ones.

Additional context

The Manage Server permission is required, so only Yellow roles can do it

I've already tried it on my server and it works

yuberee commented 1 month ago

Fixed by matt