diff --git a/backend/src/plugins/CustomEvents/actions/makeRoleMentionableAction.ts b/backend/src/plugins/CustomEvents/actions/makeRoleMentionableAction.ts index 637b1a10..ac5f8632 100644 --- a/backend/src/plugins/CustomEvents/actions/makeRoleMentionableAction.ts +++ b/backend/src/plugins/CustomEvents/actions/makeRoleMentionableAction.ts @@ -2,13 +2,13 @@ import { Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; import z from "zod/v4"; import { TemplateSafeValueContainer } from "../../../templateFormatter.js"; -import { convertDelayStringToMS, noop, zDelayString, zSnowflake } from "../../../utils.js"; +import { convertDelayStringToMS, noop, zBoundedCharacters, zDelayString } from "../../../utils.js"; import { ActionError } from "../ActionError.js"; import { CustomEventsPluginType, TCustomEvent } from "../types.js"; export const zMakeRoleMentionableAction = z.strictObject({ type: z.literal("make_role_mentionable"), - role: zSnowflake, + role: zBoundedCharacters(0, 100), timeout: zDelayString, }); export type TMakeRoleMentionableAction = z.infer; diff --git a/backend/src/plugins/CustomEvents/actions/messageAction.ts b/backend/src/plugins/CustomEvents/actions/messageAction.ts index 645483ef..4f46a512 100644 --- a/backend/src/plugins/CustomEvents/actions/messageAction.ts +++ b/backend/src/plugins/CustomEvents/actions/messageAction.ts @@ -2,14 +2,14 @@ import { Snowflake, TextChannel } from "discord.js"; import { GuildPluginData } from "knub"; import z from "zod/v4"; import { TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js"; -import { zBoundedCharacters, zSnowflake } from "../../../utils.js"; +import { zBoundedCharacters } from "../../../utils.js"; import { ActionError } from "../ActionError.js"; import { catchTemplateError } from "../catchTemplateError.js"; import { CustomEventsPluginType } from "../types.js"; export const zMessageAction = z.strictObject({ type: z.literal("message"), - channel: zSnowflake, + channel: zBoundedCharacters(0, 100), content: zBoundedCharacters(0, 4000), }); export type TMessageAction = z.infer; diff --git a/backend/src/plugins/CustomEvents/actions/moveToVoiceChannelAction.ts b/backend/src/plugins/CustomEvents/actions/moveToVoiceChannelAction.ts index ebc83383..deac4517 100644 --- a/backend/src/plugins/CustomEvents/actions/moveToVoiceChannelAction.ts +++ b/backend/src/plugins/CustomEvents/actions/moveToVoiceChannelAction.ts @@ -3,7 +3,7 @@ import { GuildPluginData } from "knub"; import z from "zod/v4"; import { canActOn } from "../../../pluginUtils.js"; import { TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js"; -import { resolveMember, zBoundedCharacters, zSnowflake } from "../../../utils.js"; +import { resolveMember, zBoundedCharacters } from "../../../utils.js"; import { ActionError } from "../ActionError.js"; import { catchTemplateError } from "../catchTemplateError.js"; import { CustomEventsPluginType, TCustomEvent } from "../types.js"; @@ -11,7 +11,7 @@ import { CustomEventsPluginType, TCustomEvent } from "../types.js"; export const zMoveToVoiceChannelAction = z.strictObject({ type: z.literal("move_to_vc"), target: zBoundedCharacters(0, 100), - channel: zSnowflake, + channel: zBoundedCharacters(0, 100), }); export type TMoveToVoiceChannelAction = z.infer; diff --git a/backend/src/plugins/CustomEvents/actions/setChannelPermissionOverrides.ts b/backend/src/plugins/CustomEvents/actions/setChannelPermissionOverrides.ts index 39cb5e3e..aa57d2eb 100644 --- a/backend/src/plugins/CustomEvents/actions/setChannelPermissionOverrides.ts +++ b/backend/src/plugins/CustomEvents/actions/setChannelPermissionOverrides.ts @@ -2,13 +2,13 @@ import { PermissionsBitField, PermissionsString, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; import z from "zod/v4"; import { TemplateSafeValueContainer } from "../../../templateFormatter.js"; -import { zSnowflake } from "../../../utils.js"; +import { zBoundedCharacters, zSnowflake } from "../../../utils.js"; import { ActionError } from "../ActionError.js"; import { CustomEventsPluginType, TCustomEvent } from "../types.js"; export const zSetChannelPermissionOverridesAction = z.strictObject({ type: z.literal("set_channel_permission_overrides"), - channel: zSnowflake, + channel: zBoundedCharacters(0, 100), overrides: z .array( z.strictObject({