types(ThreadOnlyChannel): remove incorrect messages property (#10708)

* types(ThreadOnlyChannel): remove incorrect `messages` property

Co-authored-by: TÆMBØ <TAEMBO@users.noreply.github.com>

* test: t e s t s

* test: revamp tests

---------

Co-authored-by: TÆMBØ <TAEMBO@users.noreply.github.com>
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
Danial Raza
2025-01-18 08:38:00 +01:00
committed by Jiralite
parent d2e1924fa6
commit 44a1e85847
2 changed files with 12 additions and 0 deletions

View File

@@ -2752,6 +2752,7 @@ export interface ThreadOnlyChannel
| 'awaitMessages'
| 'createMessageComponentCollector'
| 'awaitMessageComponent'
| 'messages'
> {}
export abstract class ThreadOnlyChannel extends GuildChannel {
public type: ChannelType.GuildForum | ChannelType.GuildMedia;

View File

@@ -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<GuildMessageManager>(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' }],