3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00
zeppelin/backend/src/plugins/Automod/triggers/antiraidLevel.ts

33 lines
716 B
TypeScript
Raw Normal View History

2021-04-02 17:53:16 +03:00
import * as t from "io-ts";
import { automodTrigger } from "../helpers";
import { tNullable } from "../../../utils";
// tslint:disable-next-line
interface AntiraidLevelTriggerResult {}
export const AntiraidLevelTrigger = automodTrigger<AntiraidLevelTriggerResult>()({
configType: t.type({
level: tNullable(t.string),
}),
defaultConfig: {},
async match({ triggerConfig, context, pluginData }) {
if (!context.antiraid) {
return;
}
if (context.antiraid.level !== triggerConfig.level) {
return;
}
return {
extra: {},
};
},
renderMatchInformation({ matchResult, pluginData, contexts, triggerConfig }) {
return `Antiraid level was set to ...`;
},
});