3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-13 13:25:03 +00:00

more typings

Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
metal 2023-03-11 14:55:31 +00:00 committed by GitHub
parent 010451c7e7
commit b9f2aee8b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 44 additions and 30 deletions

View file

@ -1,5 +1,5 @@
import { GuildFeature, ThreadAutoArchiveDuration } from "discord-api-types/v9";
import { ChannelType, TextChannel } from "discord.js";
import { BaseGuildTextChannel, ChannelType, GuildTextBasedChannel, TextChannel } from "discord.js";
import * as t from "io-ts";
import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter";
import { convertDelayStringToMS, MINUTES, noop, tDelayString, tNullable } from "../../../utils";
@ -52,7 +52,7 @@ export const StartThreadAction = automodAction({
: ThreadAutoArchiveDuration.OneHour;
for (const threadContext of threads) {
const channel = pluginData.guild.channels.cache.get(threadContext.message!.channel_id) as TextChannel;
const channel = pluginData.guild.channels.cache.get(threadContext.message!.channel_id) as BaseGuildTextChannel;
const renderThreadName = async (str: string) =>
renderTemplate(
str,
@ -62,7 +62,7 @@ export const StartThreadAction = automodAction({
}),
);
const threadName = await renderThreadName(actionConfig.name ?? "{user.tag}s thread");
const thread = await channel.threads
const thread = await channel!.threads
.create({
name: threadName,
autoArchiveDuration: autoArchive,