Skip to content

Commit 2569513

Browse files
committed
fix: more config type fixes for custom_events
1 parent ff3c02b commit 2569513

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

backend/src/plugins/CustomEvents/actions/makeRoleMentionableAction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import { Snowflake } from "discord.js";
22
import { GuildPluginData } from "knub";
33
import z from "zod/v4";
44
import { TemplateSafeValueContainer } from "../../../templateFormatter.js";
5-
import { convertDelayStringToMS, noop, zDelayString, zSnowflake } from "../../../utils.js";
5+
import { convertDelayStringToMS, noop, zBoundedCharacters, zDelayString } from "../../../utils.js";
66
import { ActionError } from "../ActionError.js";
77
import { CustomEventsPluginType, TCustomEvent } from "../types.js";
88

99
export const zMakeRoleMentionableAction = z.strictObject({
1010
type: z.literal("make_role_mentionable"),
11-
role: zSnowflake,
11+
role: zBoundedCharacters(0, 100),
1212
timeout: zDelayString,
1313
});
1414
export type TMakeRoleMentionableAction = z.infer<typeof zMakeRoleMentionableAction>;

backend/src/plugins/CustomEvents/actions/messageAction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import { Snowflake, TextChannel } from "discord.js";
22
import { GuildPluginData } from "knub";
33
import z from "zod/v4";
44
import { TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js";
5-
import { zBoundedCharacters, zSnowflake } from "../../../utils.js";
5+
import { zBoundedCharacters } from "../../../utils.js";
66
import { ActionError } from "../ActionError.js";
77
import { catchTemplateError } from "../catchTemplateError.js";
88
import { CustomEventsPluginType } from "../types.js";
99

1010
export const zMessageAction = z.strictObject({
1111
type: z.literal("message"),
12-
channel: zSnowflake,
12+
channel: zBoundedCharacters(0, 100),
1313
content: zBoundedCharacters(0, 4000),
1414
});
1515
export type TMessageAction = z.infer<typeof zMessageAction>;

backend/src/plugins/CustomEvents/actions/moveToVoiceChannelAction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import { GuildPluginData } from "knub";
33
import z from "zod/v4";
44
import { canActOn } from "../../../pluginUtils.js";
55
import { TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js";
6-
import { resolveMember, zBoundedCharacters, zSnowflake } from "../../../utils.js";
6+
import { resolveMember, zBoundedCharacters } from "../../../utils.js";
77
import { ActionError } from "../ActionError.js";
88
import { catchTemplateError } from "../catchTemplateError.js";
99
import { CustomEventsPluginType, TCustomEvent } from "../types.js";
1010

1111
export const zMoveToVoiceChannelAction = z.strictObject({
1212
type: z.literal("move_to_vc"),
1313
target: zBoundedCharacters(0, 100),
14-
channel: zSnowflake,
14+
channel: zBoundedCharacters(0, 100),
1515
});
1616
export type TMoveToVoiceChannelAction = z.infer<typeof zMoveToVoiceChannelAction>;
1717

backend/src/plugins/CustomEvents/actions/setChannelPermissionOverrides.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import { PermissionsBitField, PermissionsString, Snowflake } from "discord.js";
22
import { GuildPluginData } from "knub";
33
import z from "zod/v4";
44
import { TemplateSafeValueContainer } from "../../../templateFormatter.js";
5-
import { zSnowflake } from "../../../utils.js";
5+
import { zBoundedCharacters, zSnowflake } from "../../../utils.js";
66
import { ActionError } from "../ActionError.js";
77
import { CustomEventsPluginType, TCustomEvent } from "../types.js";
88

99
export const zSetChannelPermissionOverridesAction = z.strictObject({
1010
type: z.literal("set_channel_permission_overrides"),
11-
channel: zSnowflake,
11+
channel: zBoundedCharacters(0, 100),
1212
overrides: z
1313
.array(
1414
z.strictObject({

0 commit comments

Comments
 (0)