fix: automod types
This commit is contained in:
parent
5a5be89573
commit
e4b098b563
3 changed files with 9 additions and 9 deletions
|
@ -2,7 +2,7 @@ import { PermissionsBitField, PermissionsString } from "discord.js";
|
|||
import { U } from "ts-toolbelt";
|
||||
import z from "zod";
|
||||
import { TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter";
|
||||
import { isValidSnowflake, keys, noop, zSnowflake } from "../../../utils";
|
||||
import { isValidSnowflake, keys, noop, zBoundedCharacters, zSnowflake } from "../../../utils";
|
||||
import {
|
||||
guildToTemplateSafeGuild,
|
||||
savedMessageToTemplateSafeSavedMessage,
|
||||
|
@ -66,8 +66,8 @@ const allPermissionNames = [...permissionNames, ...legacyPermissionNames] as con
|
|||
|
||||
export const ChangePermsAction = automodAction({
|
||||
configSchema: z.strictObject({
|
||||
target: zSnowflake,
|
||||
channel: zSnowflake.nullable().default(null),
|
||||
target: zBoundedCharacters(1, 255),
|
||||
channel: zBoundedCharacters(1, 255).nullable().default(null),
|
||||
perms: z.record(
|
||||
z.enum(allPermissionNames),
|
||||
z.boolean().nullable(),
|
||||
|
|
|
@ -16,7 +16,7 @@ interface TMessageSpamMatchResultType {
|
|||
const configSchema = z.strictObject({
|
||||
amount: z.number().int(),
|
||||
within: zDelayString,
|
||||
per_channel: z.boolean().optional(),
|
||||
per_channel: z.boolean().nullable().default(false),
|
||||
});
|
||||
|
||||
export function createMessageSpamTrigger(spamType: RecentActionType, prettyName: string) {
|
||||
|
|
|
@ -21,18 +21,18 @@ const regexCache = new WeakMap<any, RegExp[]>();
|
|||
const quickLinkCheck = /^https?:\/\//i;
|
||||
|
||||
const configSchema = z.strictObject({
|
||||
include_domains: z.array(z.string().max(255)).max(255).optional(),
|
||||
exclude_domains: z.array(z.string().max(255)).max(255).optional(),
|
||||
include_domains: z.array(z.string().max(255)).max(700).optional(),
|
||||
exclude_domains: z.array(z.string().max(255)).max(700).optional(),
|
||||
include_subdomains: z.boolean().default(true),
|
||||
include_words: z.array(z.string().max(2000)).max(512).optional(),
|
||||
exclude_words: z.array(z.string().max(2000)).max(512).optional(),
|
||||
include_words: z.array(z.string().max(2000)).max(700).optional(),
|
||||
exclude_words: z.array(z.string().max(2000)).max(700).optional(),
|
||||
include_regex: z.array(zRegex(z.string().max(2000))).max(512).optional(),
|
||||
exclude_regex: z.array(zRegex(z.string().max(2000))).max(512).optional(),
|
||||
phisherman: z.strictObject({
|
||||
include_suspected: z.boolean().optional(),
|
||||
include_verified: z.boolean().optional(),
|
||||
}).optional(),
|
||||
only_real_links: z.boolean(),
|
||||
only_real_links: z.boolean().default(true),
|
||||
match_messages: z.boolean().default(true),
|
||||
match_embeds: z.boolean().default(true),
|
||||
match_visible_names: z.boolean().default(false),
|
||||
|
|
Loading…
Add table
Reference in a new issue