We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 04dad96 commit 65374afCopy full SHA for 65374af
1 file changed
src/events/spam-detection/rules.ts
@@ -13,8 +13,9 @@ type CheckRuleOptions = {
13
};
14
15
export async function checkRules(newMessage: Message): Promise<void> {
16
- const startTime = Date.now() - MAX_RULE_TIMEFRAME * 1.5; // Slightly extend timeframe to ensure we catch all relevant messages;
17
- const userMessages = cachedMessages.getMessagesInTimeRange(newMessage.author.id, startTime);
+ const startTime = Date.now();
+ const maxLookback = startTime - MAX_RULE_TIMEFRAME * 1.5;
18
+ const userMessages = cachedMessages.getMessagesInTimeRange(newMessage.author.id, maxLookback);
19
20
for (const rule of rules) {
21
const result = checkRule({
0 commit comments