mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-06-16 19:15:03 +00:00
fix: custom_events config types not allowing template variables
This commit is contained in:
parent
b0a4081a26
commit
ab57916a52
3 changed files with 7 additions and 7 deletions
|
@ -2,14 +2,14 @@ import { GuildPluginData } from "knub";
|
|||
import z from "zod/v4";
|
||||
import { canActOn } from "../../../pluginUtils.js";
|
||||
import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter.js";
|
||||
import { resolveMember, zSnowflake } from "../../../utils.js";
|
||||
import { resolveMember, zBoundedCharacters, zSnowflake } from "../../../utils.js";
|
||||
import { ActionError } from "../ActionError.js";
|
||||
import { catchTemplateError } from "../catchTemplateError.js";
|
||||
import { CustomEventsPluginType, TCustomEvent } from "../types.js";
|
||||
|
||||
export const zAddRoleAction = z.strictObject({
|
||||
type: z.literal("add_role"),
|
||||
target: zSnowflake,
|
||||
target: zBoundedCharacters(0, 100),
|
||||
role: z.union([zSnowflake, z.array(zSnowflake)]),
|
||||
});
|
||||
export type TAddRoleAction = z.infer<typeof zAddRoleAction>;
|
||||
|
|
|
@ -2,7 +2,7 @@ import { GuildPluginData } from "knub";
|
|||
import z from "zod/v4";
|
||||
import { CaseTypes } from "../../../data/CaseTypes.js";
|
||||
import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter.js";
|
||||
import { zBoundedCharacters, zSnowflake } from "../../../utils.js";
|
||||
import { zBoundedCharacters } from "../../../utils.js";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin.js";
|
||||
import { ActionError } from "../ActionError.js";
|
||||
import { catchTemplateError } from "../catchTemplateError.js";
|
||||
|
@ -11,8 +11,8 @@ import { CustomEventsPluginType, TCustomEvent } from "../types.js";
|
|||
export const zCreateCaseAction = z.strictObject({
|
||||
type: z.literal("create_case"),
|
||||
case_type: zBoundedCharacters(0, 32),
|
||||
mod: zSnowflake,
|
||||
target: zSnowflake,
|
||||
mod: zBoundedCharacters(0, 100),
|
||||
target: zBoundedCharacters(0, 100),
|
||||
reason: zBoundedCharacters(0, 4000),
|
||||
});
|
||||
export type TCreateCaseAction = z.infer<typeof zCreateCaseAction>;
|
||||
|
|
|
@ -3,14 +3,14 @@ import { GuildPluginData } from "knub";
|
|||
import z from "zod/v4";
|
||||
import { canActOn } from "../../../pluginUtils.js";
|
||||
import { TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js";
|
||||
import { resolveMember, zSnowflake } from "../../../utils.js";
|
||||
import { resolveMember, zBoundedCharacters, zSnowflake } from "../../../utils.js";
|
||||
import { ActionError } from "../ActionError.js";
|
||||
import { catchTemplateError } from "../catchTemplateError.js";
|
||||
import { CustomEventsPluginType, TCustomEvent } from "../types.js";
|
||||
|
||||
export const zMoveToVoiceChannelAction = z.strictObject({
|
||||
type: z.literal("move_to_vc"),
|
||||
target: zSnowflake,
|
||||
target: zBoundedCharacters(0, 100),
|
||||
channel: zSnowflake,
|
||||
});
|
||||
export type TMoveToVoiceChannelAction = z.infer<typeof zMoveToVoiceChannelAction>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue