aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord.js/BushGuildManager.d.ts
blob: 95719a36145332a6bd1e17cf383984abfbe12c32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import type { BushClient, BushGuild, BushGuildResolvable } from '#lib';
import {
	CachedManager,
	type Collection,
	type FetchGuildOptions,
	type FetchGuildsOptions,
	type GuildCreateOptions,
	type OAuth2Guild,
	type Snowflake
} from 'discord.js';
import { type RawGuildData } from 'discord.js/typings/rawDataTypes';

/**
 * Manages API methods for Guilds and stores their cache.
 */
export class BushGuildManager extends CachedManager<Snowflake, BushGuild, BushGuildResolvable> {
	public constructor(client: BushClient, iterable?: Iterable<RawGuildData>);

	/**
	 * Creates a guild.
	 * <warn>This is only available to bots in fewer than 10 guilds.</warn>
	 * @param name The name of the guild
	 * @param options Options for creating the guild
	 * @returns The guild that was created
	 */
	public create(name: string, options?: GuildCreateOptions): Promise<BushGuild>;

	/**
	 * Obtains one or multiple guilds from Discord, or the guild cache if it's already available.
	 * @param options The guild's id or options
	 */
	public fetch(options: Snowflake | FetchGuildOptions): Promise<BushGuild>;
	public fetch(options?: FetchGuildsOptions): Promise<Collection<Snowflake, OAuth2Guild>>;
}