Type fixes + use template safe values for renderTemplate() everywhere
This commit is contained in:
parent
e16eb8c8d1
commit
d109a58cb7
21 changed files with 190 additions and 98 deletions
|
@ -2,7 +2,7 @@ import { MessageOptions, Permissions, Snowflake, TextChannel, User } from "disco
|
|||
import * as t from "io-ts";
|
||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { renderTemplate } from "../../../templateFormatter";
|
||||
import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter";
|
||||
import {
|
||||
convertDelayStringToMS,
|
||||
noop,
|
||||
|
@ -48,9 +48,12 @@ export const ReplyAction = automodAction({
|
|||
const user = users[0];
|
||||
|
||||
const renderReplyText = async str =>
|
||||
renderTemplate(str, {
|
||||
user: userToTemplateSafeUser(user),
|
||||
});
|
||||
renderTemplate(
|
||||
str,
|
||||
new TemplateSafeValueContainer({
|
||||
user: userToTemplateSafeUser(user),
|
||||
}),
|
||||
);
|
||||
const formatted =
|
||||
typeof actionConfig === "string"
|
||||
? await renderReplyText(actionConfig)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue