mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
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:
1
packages/discord.js/typings/index.d.ts
vendored
1
packages/discord.js/typings/index.d.ts
vendored
@@ -2653,6 +2653,7 @@ export interface ThreadOnlyChannel
|
||||
| 'awaitMessages'
|
||||
| 'createMessageComponentCollector'
|
||||
| 'awaitMessageComponent'
|
||||
| 'messages'
|
||||
> {}
|
||||
export abstract class ThreadOnlyChannel extends GuildChannel {
|
||||
public type: ChannelType.GuildForum | ChannelType.GuildMedia;
|
||||
|
||||
@@ -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' }],
|
||||
|
||||
Reference in New Issue
Block a user