automod: fix memberJoinSpam trigger returning duplicate contexts
This commit is contained in:
parent
2b92f726e1
commit
4931c95872
1 changed files with 2 additions and 6 deletions
|
@ -30,11 +30,7 @@ export const MemberJoinSpamTrigger = automodTrigger<unknown>()({
|
||||||
const totalCount = sumRecentActionCounts(matchingActions);
|
const totalCount = sumRecentActionCounts(matchingActions);
|
||||||
|
|
||||||
if (totalCount >= triggerConfig.amount) {
|
if (totalCount >= triggerConfig.amount) {
|
||||||
const contexts = [context, ...matchingActions.map(a => a.context).filter(c => c !== context)];
|
const extraContexts = matchingActions.map(a => a.context).filter(c => c !== context);
|
||||||
|
|
||||||
for (const _context of contexts) {
|
|
||||||
_context.actioned = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
pluginData.state.recentSpam.push({
|
pluginData.state.recentSpam.push({
|
||||||
type: RecentActionType.MemberJoin,
|
type: RecentActionType.MemberJoin,
|
||||||
|
@ -44,7 +40,7 @@ export const MemberJoinSpamTrigger = automodTrigger<unknown>()({
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
extraContexts: contexts,
|
extraContexts,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue