mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-06-07 16:05:01 +00:00
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
|
@ -1,7 +1,7 @@
|
|||
import { Snowflake, TextChannel } from "discord.js";
|
||||
import * as t from "io-ts";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { renderTemplate } from "../../../templateFormatter";
|
||||
import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter";
|
||||
import { ActionError } from "../ActionError";
|
||||
import { CustomEventsPluginType } from "../types";
|
||||
|
||||
|
@ -15,7 +15,7 @@ export type TMessageAction = t.TypeOf<typeof MessageAction>;
|
|||
export async function messageAction(
|
||||
pluginData: GuildPluginData<CustomEventsPluginType>,
|
||||
action: TMessageAction,
|
||||
values: any,
|
||||
values: TemplateSafeValueContainer,
|
||||
) {
|
||||
const targetChannelId = await renderTemplate(action.channel, values, false);
|
||||
const targetChannel = pluginData.guild.channels.cache.get(targetChannelId as Snowflake);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue