diff --git a/backend/src/plugins/Automod/actions/reply.ts b/backend/src/plugins/Automod/actions/reply.ts index 139308ba..d40681e3 100644 --- a/backend/src/plugins/Automod/actions/reply.ts +++ b/backend/src/plugins/Automod/actions/reply.ts @@ -11,6 +11,7 @@ import { tMessageContent, tNullable, unique, + validateAndParseMessageContent, verboseChannelMention, } from "../../../utils"; import { hasDiscordPermissions } from "../../../utils/hasDiscordPermissions"; @@ -57,6 +58,7 @@ export const ReplyAction = automodAction({ user: userToTemplateSafeUser(user), }), ); + const formatted = typeof actionConfig === "string" ? await renderReplyText(actionConfig) @@ -91,7 +93,7 @@ export const ReplyAction = automodAction({ continue; } - const messageContent: MessageOptions = typeof formatted === "string" ? { content: formatted } : formatted; + const messageContent = validateAndParseMessageContent(formatted); const replyMsg = await channel.send({ ...messageContent, allowedMentions: { diff --git a/backend/src/utils.ts b/backend/src/utils.ts index 57ab0888..1c919770 100644 --- a/backend/src/utils.ts +++ b/backend/src/utils.ts @@ -409,6 +409,7 @@ export const tStrictMessageContent = t.type({ content: tNullable(t.string), tts: tNullable(t.boolean), disableEveryone: tNullable(t.boolean), + embed: tNullable(tEmbed), embeds: tNullable(t.array(tEmbed)), });