forked from Galactic/galactic-bot
regex & ratelimiter tweaks
This commit is contained in:
parent
03f39baf0d
commit
ba7d4985ec
@ -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
|
||||
|
||||
}
|
||||
|
||||
|
@ -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']
|
||||
|
@ -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]
|
||||
|
@ -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.
|
||||
|
||||
|
@ -136,7 +136,7 @@ class Util {
|
||||
}
|
||||
|
||||
static get regChars() {
|
||||
return ['.', '+', '*', '?', '\\[', '\\]', '^', '$', '(', ')', '{', '}', '=', '<', '>', '|', ':', '\\\\', '-'];
|
||||
return ['.', '+', '*', '?', '\\[', '\\]', '^', '$', '(', ')', '{', '}', '|', '\\\\', '-'];
|
||||
}
|
||||
|
||||
static duration(seconds) {
|
||||
|
Loading…
Reference in New Issue
Block a user