mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
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 { U } from "ts-toolbelt";
|
||||||
import z from "zod";
|
import z from "zod";
|
||||||
import { TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter";
|
import { TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter";
|
||||||
import { isValidSnowflake, keys, noop, zSnowflake } from "../../../utils";
|
import { isValidSnowflake, keys, noop, zBoundedCharacters, zSnowflake } from "../../../utils";
|
||||||
import {
|
import {
|
||||||
guildToTemplateSafeGuild,
|
guildToTemplateSafeGuild,
|
||||||
savedMessageToTemplateSafeSavedMessage,
|
savedMessageToTemplateSafeSavedMessage,
|
||||||
|
@ -66,8 +66,8 @@ const allPermissionNames = [...permissionNames, ...legacyPermissionNames] as con
|
||||||
|
|
||||||
export const ChangePermsAction = automodAction({
|
export const ChangePermsAction = automodAction({
|
||||||
configSchema: z.strictObject({
|
configSchema: z.strictObject({
|
||||||
target: zSnowflake,
|
target: zBoundedCharacters(1, 255),
|
||||||
channel: zSnowflake.nullable().default(null),
|
channel: zBoundedCharacters(1, 255).nullable().default(null),
|
||||||
perms: z.record(
|
perms: z.record(
|
||||||
z.enum(allPermissionNames),
|
z.enum(allPermissionNames),
|
||||||
z.boolean().nullable(),
|
z.boolean().nullable(),
|
||||||
|
|
|
@ -16,7 +16,7 @@ interface TMessageSpamMatchResultType {
|
||||||
const configSchema = z.strictObject({
|
const configSchema = z.strictObject({
|
||||||
amount: z.number().int(),
|
amount: z.number().int(),
|
||||||
within: zDelayString,
|
within: zDelayString,
|
||||||
per_channel: z.boolean().optional(),
|
per_channel: z.boolean().nullable().default(false),
|
||||||
});
|
});
|
||||||
|
|
||||||
export function createMessageSpamTrigger(spamType: RecentActionType, prettyName: string) {
|
export function createMessageSpamTrigger(spamType: RecentActionType, prettyName: string) {
|
||||||
|
|
|
@ -21,18 +21,18 @@ const regexCache = new WeakMap<any, RegExp[]>();
|
||||||
const quickLinkCheck = /^https?:\/\//i;
|
const quickLinkCheck = /^https?:\/\//i;
|
||||||
|
|
||||||
const configSchema = z.strictObject({
|
const configSchema = z.strictObject({
|
||||||
include_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(255).optional(),
|
exclude_domains: z.array(z.string().max(255)).max(700).optional(),
|
||||||
include_subdomains: z.boolean().default(true),
|
include_subdomains: z.boolean().default(true),
|
||||||
include_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(512).optional(),
|
exclude_words: z.array(z.string().max(2000)).max(700).optional(),
|
||||||
include_regex: z.array(zRegex(z.string().max(2000))).max(512).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(),
|
exclude_regex: z.array(zRegex(z.string().max(2000))).max(512).optional(),
|
||||||
phisherman: z.strictObject({
|
phisherman: z.strictObject({
|
||||||
include_suspected: z.boolean().optional(),
|
include_suspected: z.boolean().optional(),
|
||||||
include_verified: z.boolean().optional(),
|
include_verified: z.boolean().optional(),
|
||||||
}).optional(),
|
}).optional(),
|
||||||
only_real_links: z.boolean(),
|
only_real_links: z.boolean().default(true),
|
||||||
match_messages: z.boolean().default(true),
|
match_messages: z.boolean().default(true),
|
||||||
match_embeds: z.boolean().default(true),
|
match_embeds: z.boolean().default(true),
|
||||||
match_visible_names: z.boolean().default(false),
|
match_visible_names: z.boolean().default(false),
|
||||||
|
|
Loading…
Add table
Reference in a new issue