From 44a1e858473a51809cb1e6114d6a659fe28587f0 Mon Sep 17 00:00:00 2001 From: Danial Raza Date: Sat, 18 Jan 2025 08:38:00 +0100 Subject: [PATCH] types(ThreadOnlyChannel): remove incorrect `messages` property (#10708) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * types(ThreadOnlyChannel): remove incorrect `messages` property Co-authored-by: TÆMBØ * test: t e s t s * test: revamp tests --------- Co-authored-by: TÆMBØ Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> --- packages/discord.js/typings/index.d.ts | 1 + packages/discord.js/typings/index.test-d.ts | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index e9068fd0f..0c965f2a0 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -2752,6 +2752,7 @@ export interface ThreadOnlyChannel | 'awaitMessages' | 'createMessageComponentCollector' | 'awaitMessageComponent' + | 'messages' > {} export abstract class ThreadOnlyChannel extends GuildChannel { public type: ChannelType.GuildForum | ChannelType.GuildMedia; diff --git a/packages/discord.js/typings/index.test-d.ts b/packages/discord.js/typings/index.test-d.ts index c21271cf6..a107c8549 100644 --- a/packages/discord.js/typings/index.test-d.ts +++ b/packages/discord.js/typings/index.test-d.ts @@ -214,6 +214,7 @@ import { PollData, UserManager, InteractionCallbackResponse, + ThreadOnlyChannel, } from '.'; import { expectAssignable, @@ -2457,6 +2458,16 @@ declare const partialGroupDMChannel: PartialGroupDMChannel; declare const categoryChannel: CategoryChannel; declare const stageChannel: StageChannel; declare const forumChannel: ForumChannel; +declare const mediaChannel: MediaChannel; +declare const threadOnlyChannel: ThreadOnlyChannel; + +// Threads have messages. +expectType(threadChannel.messages); + +// Thread-only channels have threads—not messages. +notPropertyOf(threadOnlyChannel, 'messages'); +notPropertyOf(forumChannel, 'messages'); +notPropertyOf(mediaChannel, 'messages'); await forumChannel.edit({ availableTags: [...forumChannel.availableTags, { name: 'tag' }],