From 870b6382253576029d25544efbdaa84080a7a924 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Wed, 18 Aug 2021 22:44:03 +0300 Subject: [PATCH] Hotfix 10 --- backend/src/plugins/Tags/util/renderTagBody.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/plugins/Tags/util/renderTagBody.ts b/backend/src/plugins/Tags/util/renderTagBody.ts index 725275f1..9e5fede7 100644 --- a/backend/src/plugins/Tags/util/renderTagBody.ts +++ b/backend/src/plugins/Tags/util/renderTagBody.ts @@ -1,7 +1,7 @@ import * as t from "io-ts"; import { GuildPluginData } from "knub"; import { ExtendedMatchParams } from "knub/dist/config/PluginConfigManager"; -import { renderTemplate } from "../../../templateFormatter"; +import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter"; import { renderRecursively, StrictMessageContent } from "../../../utils"; import { Tag, TagsPluginType } from "../types"; import { findTagByName } from "./findTagByName"; @@ -9,7 +9,7 @@ import { findTagByName } from "./findTagByName"; export async function renderTagBody( pluginData: GuildPluginData, body: t.TypeOf, - args: any[] = [], + args: unknown[] = [], extraData = {}, subTagPermissionMatchParams?: ExtendedMatchParams, ): Promise { @@ -17,7 +17,7 @@ export async function renderTagBody( const maxTagFnCalls = 25; let tagFnCalls = 0; - const data = { + const data = new TemplateSafeValueContainer({ args, ...extraData, ...pluginData.state.tagFunctions, @@ -51,7 +51,7 @@ export async function renderTagBody( const rendered = await renderTagBody(pluginData, subTagBody, subTagArgs, subTagPermissionMatchParams); return rendered.content!; }, - }; + }); if (typeof body === "string") { // Plain text tag