regex & ratelimiter tweaks

This commit is contained in:
Erik 2021-06-10 17:55:52 +03:00
parent 03f39baf0d
commit ba7d4985ec
No known key found for this signature in database
GPG Key ID: 7E862371D3409F16
5 changed files with 6 additions and 5 deletions

View File

@ -17,8 +17,8 @@ class RateLimiter {
this.lastSend = {}; //used by limitSend
this.sendInterval = 7.5 * 1000; //How frequently sending is allowed in seconds
this.deleteInterval = 2.5; //How frequently delete queues should be executed
this.sendInterval = 7.5; //How frequently sending is allowed in seconds
this.deleteInterval = 1.5; //How frequently delete queues should be executed
}

View File

@ -79,7 +79,7 @@ module.exports = class WordFilter extends FilterSetting {
// eslint-disable-next-line prefer-const
let [first, ...rest] = args; // First arg should skip sanitisation
if (method === 'regex') rest = rest.map((arg) => Util.sanitiseRegex(arg, ['?', '\\', '(', ')', '|', '\\[', '\\]', '.', '-', '<']));
if (method === 'regex') rest = rest.map((arg) => Util.sanitiseRegex(arg, ['?', '\\', '(', ')', '|', '\\[', '\\]', '.', '-']));
const resolved = await resolver.resolveMethod([first, ...rest], {
existing: setting[method],
allowedMethods: ['add', 'remove', 'set', 'reset', 'list']

View File

@ -621,7 +621,7 @@ Unable to find an avatar with those arguments, try a different size or format.
[C_LOOKUP_DESCRIPTION]
Looks up a discord invite code and returns the information of the invite.
[C_LOOKUP_FAILEDMATCH]
[C_LOOKUP_FAILED]
Couldn't find a discord invite code, try again.
[C_LOOKUP_NONEXISTANT]

View File

@ -266,6 +266,7 @@ Will log flagged messages to <#{channel}>.
Configure the word filtering behaviour for your server.
> Each option that is a list (explicit, fuzzy, regex, whitelist, bypass and ignore) work with the methods **add|remove|set|reset**.
> **NOTE:** Regex is meant for advanced users, if you do not understand how to use regex, ask someone who does or use the presets or other available filters.
> Silent means that the bot will not respond in chat. If actions are set in place the bot will DM if configured.

View File

@ -136,7 +136,7 @@ class Util {
}
static get regChars() {
return ['.', '+', '*', '?', '\\[', '\\]', '^', '$', '(', ')', '{', '}', '=', '<', '>', '|', ':', '\\\\', '-'];
return ['.', '+', '*', '?', '\\[', '\\]', '^', '$', '(', ')', '{', '}', '|', '\\\\', '-'];
}
static duration(seconds) {