types: More accurate types instead of GuildChannelResolvable (#6744)

This commit is contained in:
Jiralite
2021-10-03 14:01:38 +01:00
committed by GitHub
parent 9e421f6ccf
commit a8e60105fb
3 changed files with 27 additions and 6 deletions

14
typings/index.d.ts vendored
View File

@@ -1524,7 +1524,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>;
public addFollower(channel: TextChannelResolvable, reason?: string): Promise<NewsChannel>;
}
export class OAuth2Guild extends BaseGuild {
@@ -2664,7 +2664,7 @@ export class GuildBanManager extends CachedManager<Snowflake, GuildBan, GuildBan
export class GuildInviteManager extends DataManager<string, Invite, InviteResolvable> {
public constructor(guild: Guild, iterable?: Iterable<RawInviteData>);
public guild: Guild;
public create(channel: GuildChannelResolvable, options?: CreateInviteOptions): Promise<Invite>;
public create(channel: GuildInvitableChannelResolvable, options?: CreateInviteOptions): Promise<Invite>;
public fetch(options: InviteResolvable | FetchInviteOptions): Promise<Invite>;
public fetch(options?: FetchInvitesOptions): Promise<Collection<string, Invite>>;
public delete(invite: InviteResolvable, reason?: string): Promise<Invite>;
@@ -3836,7 +3836,7 @@ interface FetchInviteOptions extends BaseFetchOptions {
}
interface FetchInvitesOptions {
channelId?: GuildChannelResolvable;
channelId?: GuildInvitableChannelResolvable;
cache?: boolean;
}
@@ -4222,6 +4222,14 @@ export interface InviteGenerationOptions {
scopes: InviteScope[];
}
type GuildInvitableChannelResolvable =
| TextChannel
| VoiceChannel
| NewsChannel
| StoreChannel
| StageChannel
| Snowflake;
export interface CreateInviteOptions {
temporary?: boolean;
maxAge?: number;