mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
33 lines
716 B
TypeScript
33 lines
716 B
TypeScript
![]() |
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 ...`;
|
||
|
},
|
||
|
});
|