aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord.js/BushApplicationCommandManager.d.ts
blob: 7947acd69d7c0a632c8c6dde0f70381c75a5147e (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import type {
	BushApplicationCommand,
	BushApplicationCommandPermissionsManager,
	BushApplicationCommandResolvable,
	BushClient,
	BushGuildResolvable
} from '#lib';
import type { APIApplicationCommand } from 'discord-api-types';
import {
	CachedManager,
	type ApplicationCommandData,
	type Collection,
	type FetchApplicationCommandOptions,
	type Snowflake
} from 'discord.js';

export class BushApplicationCommandManager<
	ApplicationCommandScope = BushApplicationCommand<{ guild: BushGuildResolvable }>,
	PermissionsOptionsExtras = { guild: BushGuildResolvable },
	PermissionsGuildType = null
> extends CachedManager<Snowflake, ApplicationCommandScope, BushApplicationCommandResolvable> {
	public constructor(client: BushClient, iterable?: Iterable<unknown>);
	public permissions: BushApplicationCommandPermissionsManager<
		{ command?: BushApplicationCommandResolvable } & PermissionsOptionsExtras,
		{ command: BushApplicationCommandResolvable } & PermissionsOptionsExtras,
		PermissionsOptionsExtras,
		PermissionsGuildType,
		null
	>;
	private commandPath({ id, guildId }: { id?: Snowflake; guildId?: Snowflake }): unknown;
	public create(command: ApplicationCommandData): Promise<ApplicationCommandScope>;
	public create(command: ApplicationCommandData, guildId: Snowflake): Promise<BushApplicationCommand>;
	public delete(command: BushApplicationCommandResolvable, guildId?: Snowflake): Promise<ApplicationCommandScope | null>;
	public edit(command: BushApplicationCommandResolvable, data: ApplicationCommandData): Promise<ApplicationCommandScope>;
	public edit(
		command: BushApplicationCommandResolvable,
		data: ApplicationCommandData,
		guildId: Snowflake
	): Promise<BushApplicationCommand>;
	public fetch(id: Snowflake, options: FetchApplicationCommandOptions & { guildId: Snowflake }): Promise<BushApplicationCommand>;
	public fetch(options: FetchApplicationCommandOptions): Promise<Collection<string, ApplicationCommandScope>>;
	public fetch(id: Snowflake, options?: FetchApplicationCommandOptions): Promise<ApplicationCommandScope>;
	public fetch(id?: Snowflake, options?: FetchApplicationCommandOptions): Promise<Collection<Snowflake, ApplicationCommandScope>>;
	public set(commands: ApplicationCommandData[]): Promise<Collection<Snowflake, ApplicationCommandScope>>;
	public set(commands: ApplicationCommandData[], guildId: Snowflake): Promise<Collection<Snowflake, BushApplicationCommand>>;
	private static transformCommand(
		command: ApplicationCommandData
	): Omit<APIApplicationCommand, 'id' | 'application_id' | 'guild_id'>;
}