all repos — stealth-developers @ 9e70b9738062e72ae29c11654064b6f755567753

fix: use correct types for guild highlights
willow hai@wlo.moe
Thu, 05 Jun 2025 22:52:42 +0100
commit

9e70b9738062e72ae29c11654064b6f755567753

parent

9f1af9877277b5923c2695e03cbb499d7fb665e3

1 files changed, 4 insertions(+), 13 deletions(-)

jump to
M src/interactions/menus/highlight.tssrc/interactions/menus/highlight.ts

@@ -3,10 +3,9 @@ import { Logger } from "@/utils/logging";

import { ApplicationCommandType, type Attachment, - type Channel, - ChannelType, type Client, ContextMenuCommandBuilder, + type GuildTextBasedChannel, type MessageContextMenuCommandInteraction, } from "discord.js";

@@ -62,7 +61,6 @@ return;

} const videoAttachments = targetMessage.attachments.filter(isVideoAttachment); - const videoLinks = extractVideoLinks(targetMessage); if (videoAttachments.size === 0 && videoLinks.length === 0) {

@@ -73,11 +71,11 @@ });

return; } - let highlightsChannel: Channel | null = null; + let highlightsChannel: GuildTextBasedChannel | null = null; try { - highlightsChannel = await client.channels.fetch( + highlightsChannel = (await client.channels.fetch( guildConfig.highlights_channel, - ); + )) as GuildTextBasedChannel | null; } catch (e) { logger.error("failed to fetch highlights channel:", e); await interaction.editReply({

@@ -89,13 +87,6 @@

if (!highlightsChannel) { await interaction.editReply({ content: "❌ highlights channel not found.", - }); - return; - } - - if (highlightsChannel.type !== ChannelType.GuildText) { - await interaction.editReply({ - content: "❌ the highlights channel is not a text channel.", }); return; }