3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 20:35:02 +00:00

Automod work vol 2

This commit is contained in:
Dragory 2020-07-27 21:51:03 +03:00
parent f657b169df
commit 0e9f65e0d5
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
12 changed files with 420 additions and 59 deletions

View file

@ -5,7 +5,12 @@ import { automodTrigger } from "../helpers";
import { disableInlineCode, verboseChannelMention } from "../../../utils";
import { MatchableTextType, matchMultipleTextTypesOnMessage } from "../functions/matchMultipleTextTypesOnMessage";
export const MatchWordsTrigger = automodTrigger({
interface MatchResultType {
word: string;
type: MatchableTextType;
}
export const MatchWordsTrigger = automodTrigger<MatchResultType>()({
configType: t.type({
words: t.array(t.string),
case_sensitive: t.boolean,
@ -35,11 +40,6 @@ export const MatchWordsTrigger = automodTrigger({
match_custom_status: false,
},
matchResultType: t.type({
word: t.string,
type: MatchableTextType,
}),
async match({ pluginData, context, triggerConfig: trigger }) {
if (!context.message) {
return;