automod: add default configs for actions

This commit is contained in:
Dragory 2020-07-30 01:45:14 +03:00
parent 6324b9654b
commit ae97a5dded
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
16 changed files with 64 additions and 19 deletions

View file

@ -13,6 +13,10 @@ export const BanAction = automodAction({
deleteMessageDays: tNullable(t.number),
}),
defaultConfig: {
notify: null, // Use defaults from ModActions
},
async apply({ pluginData, contexts, actionConfig, matchResult }) {
const reason = actionConfig.reason || "Kicked automatically";
const contactMethods = resolveActionContactMethods(pluginData, actionConfig);
@ -20,9 +24,7 @@ export const BanAction = automodAction({
const caseArgs = {
modId: pluginData.client.user.id,
extraNotes: [
matchResult.summary, // TODO
],
extraNotes: [matchResult.fullSummary],
};
const userIdsToBan = unique(contexts.map(c => c.user?.id).filter(Boolean));