Hotfix 10
This commit is contained in:
parent
bc1c520521
commit
870b638225
1 changed files with 4 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
import * as t from "io-ts";
|
import * as t from "io-ts";
|
||||||
import { GuildPluginData } from "knub";
|
import { GuildPluginData } from "knub";
|
||||||
import { ExtendedMatchParams } from "knub/dist/config/PluginConfigManager";
|
import { ExtendedMatchParams } from "knub/dist/config/PluginConfigManager";
|
||||||
import { renderTemplate } from "../../../templateFormatter";
|
import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter";
|
||||||
import { renderRecursively, StrictMessageContent } from "../../../utils";
|
import { renderRecursively, StrictMessageContent } from "../../../utils";
|
||||||
import { Tag, TagsPluginType } from "../types";
|
import { Tag, TagsPluginType } from "../types";
|
||||||
import { findTagByName } from "./findTagByName";
|
import { findTagByName } from "./findTagByName";
|
||||||
|
@ -9,7 +9,7 @@ import { findTagByName } from "./findTagByName";
|
||||||
export async function renderTagBody(
|
export async function renderTagBody(
|
||||||
pluginData: GuildPluginData<TagsPluginType>,
|
pluginData: GuildPluginData<TagsPluginType>,
|
||||||
body: t.TypeOf<typeof Tag>,
|
body: t.TypeOf<typeof Tag>,
|
||||||
args: any[] = [],
|
args: unknown[] = [],
|
||||||
extraData = {},
|
extraData = {},
|
||||||
subTagPermissionMatchParams?: ExtendedMatchParams,
|
subTagPermissionMatchParams?: ExtendedMatchParams,
|
||||||
): Promise<StrictMessageContent> {
|
): Promise<StrictMessageContent> {
|
||||||
|
@ -17,7 +17,7 @@ export async function renderTagBody(
|
||||||
const maxTagFnCalls = 25;
|
const maxTagFnCalls = 25;
|
||||||
let tagFnCalls = 0;
|
let tagFnCalls = 0;
|
||||||
|
|
||||||
const data = {
|
const data = new TemplateSafeValueContainer({
|
||||||
args,
|
args,
|
||||||
...extraData,
|
...extraData,
|
||||||
...pluginData.state.tagFunctions,
|
...pluginData.state.tagFunctions,
|
||||||
|
@ -51,7 +51,7 @@ export async function renderTagBody(
|
||||||
const rendered = await renderTagBody(pluginData, subTagBody, subTagArgs, subTagPermissionMatchParams);
|
const rendered = await renderTagBody(pluginData, subTagBody, subTagArgs, subTagPermissionMatchParams);
|
||||||
return rendered.content!;
|
return rendered.content!;
|
||||||
},
|
},
|
||||||
};
|
});
|
||||||
|
|
||||||
if (typeof body === "string") {
|
if (typeof body === "string") {
|
||||||
// Plain text tag
|
// Plain text tag
|
||||||
|
|
Loading…
Add table
Reference in a new issue