aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord.js/BushApplicationCommandManager.d.ts
blob: 8eec9a7e0aa37fb993e41226deef572d5c0d3a52 (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
import { APIApplicationCommand } from 'discord-api-types';
import { ApplicationCommandData, CachedManager, Collection, FetchApplicationCommandOptions, Snowflake } from 'discord.js';
import { RawApplicationCommandData } from 'discord.js/typings/rawDataTypes';
import { BushApplicationCommandResolvable, BushClient } from '../discord-akairo/BushClient';
import { BushApplicationCommand } from './BushApplicationCommand';
import { BushApplicationCommandPermissionsManager } from './BushApplicationCommandPermissionsManager';
import { BushGuildResolvable } from './BushCommandInteraction';

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