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 GitHub
parent 052ed7fbe7
commit c6e16c3675
2 changed files with 12 additions and 0 deletions

View File

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

View File

@@ -213,6 +213,7 @@ import {
PollData,
InteractionCallbackResponse,
GuildScheduledEventRecurrenceRuleOptions,
ThreadOnlyChannel,
} from '.';
import { expectAssignable, expectNotAssignable, expectNotType, expectType } from 'tsd';
import type { ContextMenuCommandBuilder, SlashCommandBuilder } from '@discordjs/builders';
@@ -2453,6 +2454,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' }],