zorael / kameloso

IRC bot with Twitch support
Boost Software License 1.0
9 stars 3 forks source link

Banned phrases revisited #81

Closed zorael closed 4 years ago

zorael commented 4 years ago

This improves Twitch banned phrases and brings it up to par with link bans.

Before we had a set (albeit configurable) time a user would be timeouted with upon seeing a banned phrase. First of all, it was broken, and used std.algorithm.comparison : equal rather than std.algorithm.searching : canFind to detect the phrase. Second, it only ever repeated that timeout duration.

Now we let it escalate into a hardcoded 5 seconds -> 60 seconds -> 3600 seconds, with some grace periods to stop the user from getting a fresh 5 second ban if they immediately trigger the ban system again once the timeout ends.

Some other commits intermingled.