feat(Threads): add support for invitable in private threads (#6501)

Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com>
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
Co-authored-by: Noel <buechler.noel@outlook.com>
This commit is contained in:
ckohen
2021-08-29 05:23:01 -07:00
committed by GitHub
parent 0fe5f88316
commit a6932546e2
4 changed files with 36 additions and 2 deletions

8
typings/index.d.ts vendored
View File

@@ -306,7 +306,7 @@ export class BaseGuildTextChannel extends TextBasedChannel(GuildChannel) {
public defaultAutoArchiveDuration?: ThreadAutoArchiveDuration;
public messages: MessageManager;
public nsfw: boolean;
public threads: ThreadManager<AllowedThreadTypeForTextChannel>;
public threads: ThreadManager<AllowedThreadTypeForTextChannel | AllowedThreadTypeForNewsChannel>;
public topic: string | null;
public createInvite(options?: CreateInviteOptions): Promise<Invite>;
public createWebhook(name: string, options?: ChannelWebhookCreateOptions): Promise<Webhook>;
@@ -1412,6 +1412,7 @@ export class MessageSelectMenu extends BaseMessageComponent {
}
export class NewsChannel extends BaseGuildTextChannel {
public threads: ThreadManager<AllowedThreadTypeForNewsChannel>;
public type: 'GUILD_NEWS';
public addFollower(channel: GuildChannelResolvable, reason?: string): Promise<NewsChannel>;
}
@@ -1782,6 +1783,7 @@ export class TeamMember extends Base {
export class TextChannel extends BaseGuildTextChannel {
public rateLimitPerUser: number;
public threads: ThreadManager<AllowedThreadTypeForTextChannel>;
public type: 'GUILD_TEXT';
public setRateLimitPerUser(rateLimitPerUser: number, reason?: string): Promise<TextChannel>;
}
@@ -1796,6 +1798,7 @@ export class ThreadChannel extends TextBasedChannel(Channel) {
public guild: Guild;
public guildId: Snowflake;
public readonly guildMembers: Collection<Snowflake, GuildMember>;
public invitable: boolean | null;
public readonly joinable: boolean;
public readonly joined: boolean;
public locked: boolean | null;
@@ -1825,6 +1828,7 @@ export class ThreadChannel extends TextBasedChannel(Channel) {
autoArchiveDuration: ThreadAutoArchiveDuration,
reason?: string,
): Promise<ThreadChannel>;
public setInvitable(invitable?: boolean, reason?: string): Promise<ThreadChannel>;
public setLocked(locked?: boolean, reason?: string): Promise<ThreadChannel>;
public setName(name: string, reason?: string): Promise<ThreadChannel>;
public setRateLimitPerUser(rateLimitPerUser: number, reason?: string): Promise<ThreadChannel>;
@@ -4593,6 +4597,7 @@ export type ThreadChannelTypes = 'GUILD_NEWS_THREAD' | 'GUILD_PUBLIC_THREAD' | '
export interface ThreadCreateOptions<AllowedThreadType> extends StartThreadOptions {
startMessage?: MessageResolvable;
type?: AllowedThreadType;
invitable?: AllowedThreadType extends 'GUILD_PRIVATE_THREAD' | 12 ? boolean : never;
}
export interface ThreadEditData {
@@ -4601,6 +4606,7 @@ export interface ThreadEditData {
autoArchiveDuration?: ThreadAutoArchiveDuration;
rateLimitPerUser?: number;
locked?: boolean;
invitable?: boolean;
}
export type ThreadMemberFlagsString = '';