3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-11 20:55:01 +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,4 +1,4 @@
import { Snowflake, TextChannel, ThreadChannel } from "discord.js";
import { GuildTextBasedChannel, Snowflake, TextChannel, ThreadChannel } from "discord.js";
import { GuildPluginData } from "knub";
import { availableActions } from "../actions/availableActions";
import { CleanAction } from "../actions/clean";
@ -18,7 +18,7 @@ export async function runAutomod(pluginData: GuildPluginData<AutomodPluginType>,
const channelOrThread =
context.channel ??
(channelIdOrThreadId
? (pluginData.guild.channels.cache.get(channelIdOrThreadId as Snowflake) as TextChannel | ThreadChannel)
? (pluginData.guild.channels.cache.get(channelIdOrThreadId as Snowflake) as GuildTextBasedChannel)
: null);
const channelId = channelOrThread?.isThread() ? channelOrThread.parent?.id : channelIdOrThreadId;
const threadId = channelOrThread?.isThread() ? channelOrThread.id : null;