mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-07-07 02:57:20 +00:00
chore: run prettier
This commit is contained in:
parent
77ab2718e7
commit
873bf7eb99
54 changed files with 462 additions and 416 deletions
|
@ -1,5 +1,5 @@
|
|||
import { automodTrigger } from "../helpers";
|
||||
import z from "zod";
|
||||
import { automodTrigger } from "../helpers";
|
||||
|
||||
interface AntiraidLevelTriggerResult {}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import z from "zod";
|
||||
import { verboseChannelMention } from "../../../utils";
|
||||
import { automodTrigger } from "../helpers";
|
||||
import z from "zod";
|
||||
|
||||
interface AnyMessageResultType {}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { escapeInlineCode, Snowflake } from "discord.js";
|
||||
import z from "zod";
|
||||
import { extname } from "path";
|
||||
import z from "zod";
|
||||
import { asSingleLine, messageSummary, verboseChannelMention } from "../../../utils";
|
||||
import { automodTrigger } from "../helpers";
|
||||
|
||||
|
@ -9,28 +9,30 @@ interface MatchResultType {
|
|||
mode: "blacklist" | "whitelist";
|
||||
}
|
||||
|
||||
const configSchema = z.strictObject({
|
||||
filetype_blacklist: z.array(z.string().max(32)).max(255).default([]),
|
||||
blacklist_enabled: z.boolean().default(false),
|
||||
filetype_whitelist: z.array(z.string().max(32)).max(255).default([]),
|
||||
whitelist_enabled: z.boolean().default(false),
|
||||
}).transform((parsed, ctx) => {
|
||||
if (parsed.blacklist_enabled && parsed.whitelist_enabled) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: "Cannot have both blacklist and whitelist enabled",
|
||||
});
|
||||
return z.NEVER;
|
||||
}
|
||||
if (! parsed.blacklist_enabled && ! parsed.whitelist_enabled) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: "Must have either blacklist or whitelist enabled",
|
||||
});
|
||||
return z.NEVER;
|
||||
}
|
||||
return parsed;
|
||||
});
|
||||
const configSchema = z
|
||||
.strictObject({
|
||||
filetype_blacklist: z.array(z.string().max(32)).max(255).default([]),
|
||||
blacklist_enabled: z.boolean().default(false),
|
||||
filetype_whitelist: z.array(z.string().max(32)).max(255).default([]),
|
||||
whitelist_enabled: z.boolean().default(false),
|
||||
})
|
||||
.transform((parsed, ctx) => {
|
||||
if (parsed.blacklist_enabled && parsed.whitelist_enabled) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: "Cannot have both blacklist and whitelist enabled",
|
||||
});
|
||||
return z.NEVER;
|
||||
}
|
||||
if (!parsed.blacklist_enabled && !parsed.whitelist_enabled) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: "Must have either blacklist or whitelist enabled",
|
||||
});
|
||||
return z.NEVER;
|
||||
}
|
||||
return parsed;
|
||||
});
|
||||
|
||||
export const MatchAttachmentTypeTrigger = automodTrigger<MatchResultType>()({
|
||||
configSchema,
|
||||
|
|
|
@ -26,12 +26,20 @@ const configSchema = z.strictObject({
|
|||
include_subdomains: z.boolean().default(true),
|
||||
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(),
|
||||
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().default(true),
|
||||
match_messages: z.boolean().default(true),
|
||||
match_embeds: z.boolean().default(true),
|
||||
|
|
|
@ -8,28 +8,30 @@ interface MatchResultType {
|
|||
mode: "blacklist" | "whitelist";
|
||||
}
|
||||
|
||||
const configSchema = z.strictObject({
|
||||
mime_type_blacklist: z.array(z.string().max(255)).max(255).default([]),
|
||||
blacklist_enabled: z.boolean().default(false),
|
||||
mime_type_whitelist: z.array(z.string().max(255)).max(255).default([]),
|
||||
whitelist_enabled: z.boolean().default(false),
|
||||
}).transform((parsed, ctx) => {
|
||||
if (parsed.blacklist_enabled && parsed.whitelist_enabled) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: "Cannot have both blacklist and whitelist enabled",
|
||||
});
|
||||
return z.NEVER;
|
||||
}
|
||||
if (! parsed.blacklist_enabled && ! parsed.whitelist_enabled) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: "Must have either blacklist or whitelist enabled",
|
||||
});
|
||||
return z.NEVER;
|
||||
}
|
||||
return parsed;
|
||||
});
|
||||
const configSchema = z
|
||||
.strictObject({
|
||||
mime_type_blacklist: z.array(z.string().max(255)).max(255).default([]),
|
||||
blacklist_enabled: z.boolean().default(false),
|
||||
mime_type_whitelist: z.array(z.string().max(255)).max(255).default([]),
|
||||
whitelist_enabled: z.boolean().default(false),
|
||||
})
|
||||
.transform((parsed, ctx) => {
|
||||
if (parsed.blacklist_enabled && parsed.whitelist_enabled) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: "Cannot have both blacklist and whitelist enabled",
|
||||
});
|
||||
return z.NEVER;
|
||||
}
|
||||
if (!parsed.blacklist_enabled && !parsed.whitelist_enabled) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: "Must have either blacklist or whitelist enabled",
|
||||
});
|
||||
return z.NEVER;
|
||||
}
|
||||
return parsed;
|
||||
});
|
||||
|
||||
export const MatchMimeTypeTrigger = automodTrigger<MatchResultType>()({
|
||||
configSchema,
|
||||
|
|
|
@ -8,10 +8,7 @@ interface RoleAddedMatchResult {
|
|||
matchedRoleId: string;
|
||||
}
|
||||
|
||||
const configSchema = z.union([
|
||||
zSnowflake,
|
||||
z.array(zSnowflake).max(255),
|
||||
]).default([]);
|
||||
const configSchema = z.union([zSnowflake, z.array(zSnowflake).max(255)]).default([]);
|
||||
|
||||
export const RoleAddedTrigger = automodTrigger<RoleAddedMatchResult>()({
|
||||
configSchema,
|
||||
|
|
|
@ -8,10 +8,7 @@ interface RoleAddedMatchResult {
|
|||
matchedRoleId: string;
|
||||
}
|
||||
|
||||
const configSchema = z.union([
|
||||
zSnowflake,
|
||||
z.array(zSnowflake).max(255),
|
||||
]).default([]);
|
||||
const configSchema = z.union([zSnowflake, z.array(zSnowflake).max(255)]).default([]);
|
||||
|
||||
export const RoleRemovedTrigger = automodTrigger<RoleAddedMatchResult>()({
|
||||
configSchema,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue