diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-01-23 18:13:05 -0500 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-01-23 18:13:05 -0500 |
commit | a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a (patch) | |
tree | 9b0f8ed8a93c22c90512751e3f2f5937e1925760 /src/lib/extensions/discord.js/BushGuildManager.ts | |
parent | 5557677f1570eb564a30cfcebb6030235dc84d47 (diff) | |
download | tanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.tar.gz tanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.tar.bz2 tanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.zip |
fix discord.js breaking changes, some other stuff
Diffstat (limited to 'src/lib/extensions/discord.js/BushGuildManager.ts')
-rw-r--r-- | src/lib/extensions/discord.js/BushGuildManager.ts | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/lib/extensions/discord.js/BushGuildManager.ts b/src/lib/extensions/discord.js/BushGuildManager.ts new file mode 100644 index 0000000..41618e3 --- /dev/null +++ b/src/lib/extensions/discord.js/BushGuildManager.ts @@ -0,0 +1,35 @@ +import type { BushClient, BushGuild, BushGuildResolvable } from '#lib'; +import { + CachedManager, + GuildManager, + 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 declare class BushGuildManager extends CachedManager<Snowflake, BushGuild, BushGuildResolvable> implements GuildManager { + 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>>; +} |