update djs

Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
Tiago R 2023-11-26 13:16:44 +00:00
parent c4a2be5ff5
commit 43076b3db6
3 changed files with 122 additions and 182 deletions

View file

@ -57,7 +57,13 @@ export const StartThreadAction = automodAction({
for (const threadContext of threads) {
const channel = pluginData.guild.channels.cache.get(threadContext.message!.channel_id);
if (!channel || !("threads" in channel) || channel.type === ChannelType.GuildForum) continue;
if (
!channel ||
!("threads" in channel) ||
channel.type === ChannelType.GuildForum ||
channel.type === ChannelType.GuildMedia
)
continue;
const renderThreadName = async (str: string) =>
renderTemplate(
@ -90,10 +96,7 @@ export const StartThreadAction = automodAction({
.create({
...threadOptions,
type: actionConfig.private ? ChannelType.PrivateThread : ChannelType.PublicThread,
startMessage:
!actionConfig.private && guild.features.includes(GuildFeature.PrivateThreads)
? threadContext.message!.id
: undefined,
startMessage: !actionConfig.private ? threadContext.message!.id : undefined,
})
.catch(() => undefined);
}