mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +01:00
types: Narrow channel type in thread managers (#8640)
types: narrow channel type in thread managers Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -10,6 +10,12 @@ const MessagePayload = require('../structures/MessagePayload');
|
|||||||
* @extends {ThreadManager}
|
* @extends {ThreadManager}
|
||||||
*/
|
*/
|
||||||
class GuildForumThreadManager extends ThreadManager {
|
class GuildForumThreadManager extends ThreadManager {
|
||||||
|
/**
|
||||||
|
* The channel this Manager belongs to
|
||||||
|
* @name GuildForumThreadManager#channel
|
||||||
|
* @type {ForumChannel}
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {BaseMessageOptions} GuildForumThreadCreateOptions
|
* @typedef {BaseMessageOptions} GuildForumThreadCreateOptions
|
||||||
* @property {stickers} [stickers] The stickers to send with the message
|
* @property {stickers} [stickers] The stickers to send with the message
|
||||||
|
|||||||
@@ -9,6 +9,12 @@ const { ErrorCodes, TypeError } = require('../errors');
|
|||||||
* @extends {ThreadManager}
|
* @extends {ThreadManager}
|
||||||
*/
|
*/
|
||||||
class GuildTextThreadManager extends ThreadManager {
|
class GuildTextThreadManager extends ThreadManager {
|
||||||
|
/**
|
||||||
|
* The channel this Manager belongs to
|
||||||
|
* @name GuildTextThreadManager#channel
|
||||||
|
* @type {TextChannel|NewsChannel}
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Options for creating a thread. <warn>Only one of `startMessage` or `type` can be defined.</warn>
|
* Options for creating a thread. <warn>Only one of `startMessage` or `type` can be defined.</warn>
|
||||||
* @typedef {StartThreadOptions} ThreadCreateOptions
|
* @typedef {StartThreadOptions} ThreadCreateOptions
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class ThreadManager extends CachedManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The channel this Manager belongs to
|
* The channel this Manager belongs to
|
||||||
* @type {NewsChannel|TextChannel|ForumChannel}
|
* @type {TextChannel|NewsChannel|ForumChannel}
|
||||||
*/
|
*/
|
||||||
this.channel = channel;
|
this.channel = channel;
|
||||||
}
|
}
|
||||||
|
|||||||
6
packages/discord.js/typings/index.d.ts
vendored
6
packages/discord.js/typings/index.d.ts
vendored
@@ -3674,8 +3674,8 @@ export class StageInstanceManager extends CachedManager<Snowflake, StageInstance
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class ThreadManager extends CachedManager<Snowflake, ThreadChannel, ThreadChannelResolvable> {
|
export class ThreadManager extends CachedManager<Snowflake, ThreadChannel, ThreadChannelResolvable> {
|
||||||
protected constructor(channel: TextChannel | NewsChannel, iterable?: Iterable<RawThreadChannelData>);
|
protected constructor(channel: TextChannel | NewsChannel | ForumChannel, iterable?: Iterable<RawThreadChannelData>);
|
||||||
public channel: TextChannel | NewsChannel;
|
public channel: TextChannel | NewsChannel | ForumChannel;
|
||||||
public fetch(options: ThreadChannelResolvable, cacheOptions?: BaseFetchOptions): Promise<AnyThreadChannel | null>;
|
public fetch(options: ThreadChannelResolvable, cacheOptions?: BaseFetchOptions): Promise<AnyThreadChannel | null>;
|
||||||
public fetch(options?: FetchThreadsOptions, cacheOptions?: { cache?: boolean }): Promise<FetchedThreads>;
|
public fetch(options?: FetchThreadsOptions, cacheOptions?: { cache?: boolean }): Promise<FetchedThreads>;
|
||||||
public fetchArchived(options?: FetchArchivedThreadOptions, cache?: boolean): Promise<FetchedThreads>;
|
public fetchArchived(options?: FetchArchivedThreadOptions, cache?: boolean): Promise<FetchedThreads>;
|
||||||
@@ -3683,10 +3683,12 @@ export class ThreadManager extends CachedManager<Snowflake, ThreadChannel, Threa
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class GuildTextThreadManager<AllowedThreadType> extends ThreadManager {
|
export class GuildTextThreadManager<AllowedThreadType> extends ThreadManager {
|
||||||
|
public channel: TextChannel | NewsChannel;
|
||||||
public create(options: GuildTextThreadCreateOptions<AllowedThreadType>): Promise<ThreadChannel>;
|
public create(options: GuildTextThreadCreateOptions<AllowedThreadType>): Promise<ThreadChannel>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class GuildForumThreadManager extends ThreadManager {
|
export class GuildForumThreadManager extends ThreadManager {
|
||||||
|
public channel: ForumChannel;
|
||||||
public create(options: GuildForumThreadCreateOptions): Promise<ThreadChannel>;
|
public create(options: GuildForumThreadCreateOptions): Promise<ThreadChannel>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user