mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 20:43:30 +01:00
feat: add support for fetching multiple guilds (#5472)
Co-authored-by: SpaceEEC <spaceeec@yahoo.com> Co-authored-by: Noel <icrawltogo@gmail.com>
This commit is contained in:
55
typings/index.d.ts
vendored
55
typings/index.d.ts
vendored
@@ -227,6 +227,21 @@ declare module 'discord.js' {
|
||||
public toJSON(...props: { [key: string]: boolean | string }[]): object;
|
||||
}
|
||||
|
||||
export class BaseGuild extends Base {
|
||||
public readonly createdAt: Date;
|
||||
public readonly createdTimestamp: number;
|
||||
public features: GuildFeatures[];
|
||||
public icon: string | null;
|
||||
public id: Snowflake;
|
||||
public name: string;
|
||||
public readonly nameAcronym: string;
|
||||
public readonly partnered: boolean;
|
||||
public readonly verified: boolean;
|
||||
public fetch(): Promise<Guild>;
|
||||
public iconURL(options?: ImageURLOptions & { dynamic?: boolean }): string | null;
|
||||
public toString(): string;
|
||||
}
|
||||
|
||||
export class BaseGuildEmoji extends Emoji {
|
||||
constructor(client: Client, data: object, guild: Guild);
|
||||
private _roles: string[];
|
||||
@@ -702,7 +717,7 @@ declare module 'discord.js' {
|
||||
public toString(): string;
|
||||
}
|
||||
|
||||
export class Guild extends Base {
|
||||
export class Guild extends BaseGuild {
|
||||
constructor(client: Client, data: object);
|
||||
private _sortedRoles(): Collection<Snowflake, Role>;
|
||||
private _sortedChannels(channel: Channel): Collection<Snowflake, GuildChannel>;
|
||||
@@ -719,17 +734,12 @@ declare module 'discord.js' {
|
||||
public bans: GuildBanManager;
|
||||
public channels: GuildChannelManager;
|
||||
public commands: GuildApplicationCommandManager;
|
||||
public readonly createdAt: Date;
|
||||
public readonly createdTimestamp: number;
|
||||
public defaultMessageNotifications: DefaultMessageNotifications | number;
|
||||
public deleted: boolean;
|
||||
public description: string | null;
|
||||
public discoverySplash: string | null;
|
||||
public emojis: GuildEmojiManager;
|
||||
public explicitContentFilter: ExplicitContentFilterLevel;
|
||||
public features: GuildFeatures[];
|
||||
public icon: string | null;
|
||||
public id: Snowflake;
|
||||
public readonly joinedAt: Date;
|
||||
public joinedTimestamp: number;
|
||||
public large: boolean;
|
||||
@@ -739,11 +749,8 @@ declare module 'discord.js' {
|
||||
public memberCount: number;
|
||||
public members: GuildMemberManager;
|
||||
public mfaLevel: number;
|
||||
public name: string;
|
||||
public readonly nameAcronym: string;
|
||||
public nsfwLevel: NSFWLevel;
|
||||
public ownerID: Snowflake;
|
||||
public readonly partnered: boolean;
|
||||
public preferredLocale: string;
|
||||
public premiumSubscriptionCount: number | null;
|
||||
public premiumTier: PremiumTier;
|
||||
@@ -763,7 +770,6 @@ declare module 'discord.js' {
|
||||
public vanityURLCode: string | null;
|
||||
public vanityURLUses: number | null;
|
||||
public verificationLevel: VerificationLevel;
|
||||
public readonly verified: boolean;
|
||||
public readonly voiceStates: VoiceStateManager;
|
||||
public readonly widgetChannel: TextChannel | null;
|
||||
public widgetChannelID: Snowflake | null;
|
||||
@@ -776,7 +782,6 @@ declare module 'discord.js' {
|
||||
public discoverySplashURL(options?: ImageURLOptions): string | null;
|
||||
public edit(data: GuildEditData, reason?: string): Promise<Guild>;
|
||||
public equals(guild: Guild): boolean;
|
||||
public fetch(): Promise<Guild>;
|
||||
public fetchAuditLogs(options?: GuildAuditLogsFetchOptions): Promise<GuildAuditLogs>;
|
||||
public fetchIntegrations(): Promise<Collection<string, Integration>>;
|
||||
public fetchInvites(): Promise<Collection<string, Invite>>;
|
||||
@@ -787,7 +792,6 @@ declare module 'discord.js' {
|
||||
public fetchVoiceRegions(): Promise<Collection<string, VoiceRegion>>;
|
||||
public fetchWebhooks(): Promise<Collection<Snowflake, Webhook>>;
|
||||
public fetchWidget(): Promise<GuildWidget>;
|
||||
public iconURL(options?: ImageURLOptions & { dynamic?: boolean }): string | null;
|
||||
public leave(): Promise<Guild>;
|
||||
public setAFKChannel(afkChannel: ChannelResolvable | null, reason?: string): Promise<Guild>;
|
||||
public setAFKTimeout(afkTimeout: number, reason?: string): Promise<Guild>;
|
||||
@@ -817,7 +821,6 @@ declare module 'discord.js' {
|
||||
public setWidget(widget: GuildWidgetData, reason?: string): Promise<Guild>;
|
||||
public splashURL(options?: ImageURLOptions): string | null;
|
||||
public toJSON(): object;
|
||||
public toString(): string;
|
||||
}
|
||||
|
||||
export class GuildAuditLogs {
|
||||
@@ -1345,6 +1348,11 @@ declare module 'discord.js' {
|
||||
public addFollower(channel: GuildChannelResolvable, reason?: string): Promise<NewsChannel>;
|
||||
}
|
||||
|
||||
export class OAuth2Guild extends BaseGuild {
|
||||
public owner: boolean;
|
||||
public permissions: Readonly<Permissions>;
|
||||
}
|
||||
|
||||
export class PartialGroupDMChannel extends Channel {
|
||||
constructor(client: Client, data: object);
|
||||
public name: string;
|
||||
@@ -2167,7 +2175,8 @@ declare module 'discord.js' {
|
||||
export class GuildManager extends BaseManager<Snowflake, Guild, GuildResolvable> {
|
||||
constructor(client: Client, iterable?: Iterable<any>);
|
||||
public create(name: string, options?: GuildCreateOptions): Promise<Guild>;
|
||||
public fetch(id: Snowflake, cache?: boolean, force?: boolean): Promise<Guild>;
|
||||
public fetch(options: Snowflake | FetchGuildOptions): Promise<Guild>;
|
||||
public fetch(options?: FetchGuildsOptions): Promise<Collection<Snowflake, OAuth2Guild>>;
|
||||
}
|
||||
|
||||
export class GuildMemberManager extends BaseManager<Snowflake, GuildMember, GuildMemberResolvable> {
|
||||
@@ -2829,9 +2838,16 @@ declare module 'discord.js' {
|
||||
cache: boolean;
|
||||
}
|
||||
|
||||
interface GuildChannelOverwriteOptions {
|
||||
reason?: string;
|
||||
type?: number;
|
||||
interface FetchGuildOptions {
|
||||
guild: GuildResolvable;
|
||||
cache?: boolean;
|
||||
force?: boolean;
|
||||
}
|
||||
|
||||
interface FetchGuildsOptions {
|
||||
before?: Snowflake;
|
||||
after?: Snowflake;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
interface FetchMemberOptions {
|
||||
@@ -2930,6 +2946,11 @@ declare module 'discord.js' {
|
||||
|
||||
type GuildBanResolvable = GuildBan | UserResolvable;
|
||||
|
||||
interface GuildChannelOverwriteOptions {
|
||||
reason?: string;
|
||||
type?: number;
|
||||
}
|
||||
|
||||
type GuildChannelResolvable = Snowflake | GuildChannel;
|
||||
|
||||
interface GuildCreateChannelOptions {
|
||||
|
||||
Reference in New Issue
Block a user