mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-06-16 11:05:03 +00:00
fix: more config type fixes for custom_events
This commit is contained in:
parent
ff3c02bcec
commit
2569513c6c
4 changed files with 8 additions and 8 deletions
|
@ -2,13 +2,13 @@ import { Snowflake } from "discord.js";
|
||||||
import { GuildPluginData } from "knub";
|
import { GuildPluginData } from "knub";
|
||||||
import z from "zod/v4";
|
import z from "zod/v4";
|
||||||
import { TemplateSafeValueContainer } from "../../../templateFormatter.js";
|
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 { ActionError } from "../ActionError.js";
|
||||||
import { CustomEventsPluginType, TCustomEvent } from "../types.js";
|
import { CustomEventsPluginType, TCustomEvent } from "../types.js";
|
||||||
|
|
||||||
export const zMakeRoleMentionableAction = z.strictObject({
|
export const zMakeRoleMentionableAction = z.strictObject({
|
||||||
type: z.literal("make_role_mentionable"),
|
type: z.literal("make_role_mentionable"),
|
||||||
role: zSnowflake,
|
role: zBoundedCharacters(0, 100),
|
||||||
timeout: zDelayString,
|
timeout: zDelayString,
|
||||||
});
|
});
|
||||||
export type TMakeRoleMentionableAction = z.infer<typeof zMakeRoleMentionableAction>;
|
export type TMakeRoleMentionableAction = z.infer<typeof zMakeRoleMentionableAction>;
|
||||||
|
|
|
@ -2,14 +2,14 @@ import { Snowflake, TextChannel } from "discord.js";
|
||||||
import { GuildPluginData } from "knub";
|
import { GuildPluginData } from "knub";
|
||||||
import z from "zod/v4";
|
import z from "zod/v4";
|
||||||
import { TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js";
|
import { TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js";
|
||||||
import { zBoundedCharacters, zSnowflake } from "../../../utils.js";
|
import { zBoundedCharacters } from "../../../utils.js";
|
||||||
import { ActionError } from "../ActionError.js";
|
import { ActionError } from "../ActionError.js";
|
||||||
import { catchTemplateError } from "../catchTemplateError.js";
|
import { catchTemplateError } from "../catchTemplateError.js";
|
||||||
import { CustomEventsPluginType } from "../types.js";
|
import { CustomEventsPluginType } from "../types.js";
|
||||||
|
|
||||||
export const zMessageAction = z.strictObject({
|
export const zMessageAction = z.strictObject({
|
||||||
type: z.literal("message"),
|
type: z.literal("message"),
|
||||||
channel: zSnowflake,
|
channel: zBoundedCharacters(0, 100),
|
||||||
content: zBoundedCharacters(0, 4000),
|
content: zBoundedCharacters(0, 4000),
|
||||||
});
|
});
|
||||||
export type TMessageAction = z.infer<typeof zMessageAction>;
|
export type TMessageAction = z.infer<typeof zMessageAction>;
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { GuildPluginData } from "knub";
|
||||||
import z from "zod/v4";
|
import z from "zod/v4";
|
||||||
import { canActOn } from "../../../pluginUtils.js";
|
import { canActOn } from "../../../pluginUtils.js";
|
||||||
import { TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.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 { ActionError } from "../ActionError.js";
|
||||||
import { catchTemplateError } from "../catchTemplateError.js";
|
import { catchTemplateError } from "../catchTemplateError.js";
|
||||||
import { CustomEventsPluginType, TCustomEvent } from "../types.js";
|
import { CustomEventsPluginType, TCustomEvent } from "../types.js";
|
||||||
|
@ -11,7 +11,7 @@ import { CustomEventsPluginType, TCustomEvent } from "../types.js";
|
||||||
export const zMoveToVoiceChannelAction = z.strictObject({
|
export const zMoveToVoiceChannelAction = z.strictObject({
|
||||||
type: z.literal("move_to_vc"),
|
type: z.literal("move_to_vc"),
|
||||||
target: zBoundedCharacters(0, 100),
|
target: zBoundedCharacters(0, 100),
|
||||||
channel: zSnowflake,
|
channel: zBoundedCharacters(0, 100),
|
||||||
});
|
});
|
||||||
export type TMoveToVoiceChannelAction = z.infer<typeof zMoveToVoiceChannelAction>;
|
export type TMoveToVoiceChannelAction = z.infer<typeof zMoveToVoiceChannelAction>;
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,13 @@ import { PermissionsBitField, PermissionsString, Snowflake } from "discord.js";
|
||||||
import { GuildPluginData } from "knub";
|
import { GuildPluginData } from "knub";
|
||||||
import z from "zod/v4";
|
import z from "zod/v4";
|
||||||
import { TemplateSafeValueContainer } from "../../../templateFormatter.js";
|
import { TemplateSafeValueContainer } from "../../../templateFormatter.js";
|
||||||
import { zSnowflake } from "../../../utils.js";
|
import { zBoundedCharacters, zSnowflake } from "../../../utils.js";
|
||||||
import { ActionError } from "../ActionError.js";
|
import { ActionError } from "../ActionError.js";
|
||||||
import { CustomEventsPluginType, TCustomEvent } from "../types.js";
|
import { CustomEventsPluginType, TCustomEvent } from "../types.js";
|
||||||
|
|
||||||
export const zSetChannelPermissionOverridesAction = z.strictObject({
|
export const zSetChannelPermissionOverridesAction = z.strictObject({
|
||||||
type: z.literal("set_channel_permission_overrides"),
|
type: z.literal("set_channel_permission_overrides"),
|
||||||
channel: zSnowflake,
|
channel: zBoundedCharacters(0, 100),
|
||||||
overrides: z
|
overrides: z
|
||||||
.array(
|
.array(
|
||||||
z.strictObject({
|
z.strictObject({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue