automod: ensure actions only apply once per user/member

This commit is contained in:
Dragory 2020-07-29 22:58:14 +03:00
parent e55a1e3bd6
commit c39d69dd5d
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
9 changed files with 27 additions and 22 deletions

View file

@ -8,6 +8,7 @@ import {
tDelayString,
tMessageContent,
tNullable,
unique,
} from "../../../utils";
import { TextChannel } from "eris";
import { AutomodContext } from "../types";
@ -37,7 +38,7 @@ export const ReplyAction = automodAction({
}, new Map());
for (const [channelId, _contexts] of contextsByChannelId.entries()) {
const users = Array.from(new Set(_contexts.map(c => c.user).filter(Boolean)));
const users = unique(Array.from(new Set(_contexts.map(c => c.user).filter(Boolean))));
const user = users[0];
const renderReplyText = async str =>