Automod actions + ModActions public interface
This commit is contained in:
parent
0f0728bc1c
commit
86023877a2
22 changed files with 508 additions and 16 deletions
|
@ -25,7 +25,6 @@ export async function runAutomod(pluginData: PluginData<AutomodPluginType>, cont
|
|||
if (!rule.affects_bots && user.bot) continue;
|
||||
|
||||
let matchResult: AutomodTriggerMatchResult<any>;
|
||||
let matchSummary: string;
|
||||
let contexts: AutomodContext[];
|
||||
|
||||
triggerLoop: for (const triggerItem of rule.triggers) {
|
||||
|
@ -45,17 +44,7 @@ export async function runAutomod(pluginData: PluginData<AutomodPluginType>, cont
|
|||
_context.actioned = true;
|
||||
}
|
||||
|
||||
if (matchResult.silentClean) {
|
||||
await CleanAction.apply({
|
||||
ruleName,
|
||||
pluginData,
|
||||
contexts,
|
||||
actionConfig: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
matchSummary = await trigger.renderMatchInformation({
|
||||
matchResult.summary = await trigger.renderMatchInformation({
|
||||
ruleName,
|
||||
pluginData,
|
||||
contexts,
|
||||
|
@ -63,6 +52,17 @@ export async function runAutomod(pluginData: PluginData<AutomodPluginType>, cont
|
|||
triggerConfig,
|
||||
});
|
||||
|
||||
if (matchResult.silentClean) {
|
||||
await CleanAction.apply({
|
||||
ruleName,
|
||||
pluginData,
|
||||
contexts,
|
||||
actionConfig: true,
|
||||
matchResult,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
break triggerLoop;
|
||||
}
|
||||
}
|
||||
|
@ -76,6 +76,7 @@ export async function runAutomod(pluginData: PluginData<AutomodPluginType>, cont
|
|||
pluginData,
|
||||
contexts,
|
||||
actionConfig,
|
||||
matchResult,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue