aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord.js/BushApplicationCommandPermissionsManager.d.ts
blob: 443fee2120c1d4e2c8da7606b94beb8388b85e8f (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
50
51
52
53
54
import {
	ApplicationCommand,
	ApplicationCommandManager,
	ApplicationCommandPermissionData,
	ApplicationCommandPermissions,
	BaseManager,
	Collection,
	GuildApplicationCommandManager,
	GuildApplicationCommandPermissionData,
	Snowflake
} from 'discord.js';
import { BushClient, BushRoleResolvable, BushUserResolvable } from '../discord-akairo/BushClient';

export class BushApplicationCommandPermissionsManager<
	BaseOptions,
	FetchSingleOptions,
	FullPermissionsOptions,
	GuildType,
	CommandIdType
> extends BaseManager {
	public constructor(manager: ApplicationCommandManager | GuildApplicationCommandManager | ApplicationCommand);
	public declare readonly client: BushClient;
	public commandId: CommandIdType;
	public guild: GuildType;
	public guildId: Snowflake | null;
	public manager: ApplicationCommandManager | GuildApplicationCommandManager | ApplicationCommand;
	public add(
		options: FetchSingleOptions & { permissions: ApplicationCommandPermissionData[] }
	): Promise<ApplicationCommandPermissions[]>;
	public has(options: FetchSingleOptions & { permissionId: BushUserResolvable | BushRoleResolvable }): Promise<boolean>;
	public fetch(options: FetchSingleOptions): Promise<ApplicationCommandPermissions[]>;
	public fetch(options: BaseOptions): Promise<Collection<Snowflake, ApplicationCommandPermissions[]>>;
	public remove(
		options:
			| (FetchSingleOptions & {
					users: BushUserResolvable | BushUserResolvable[];
					roles?: BushRoleResolvable | BushRoleResolvable[];
			  })
			| (FetchSingleOptions & {
					users?: BushUserResolvable | BushUserResolvable[];
					roles: BushRoleResolvable | BushRoleResolvable[];
			  })
	): Promise<ApplicationCommandPermissions[]>;
	public set(
		options: FetchSingleOptions & { permissions: ApplicationCommandPermissionData[] }
	): Promise<ApplicationCommandPermissions[]>;
	public set(
		options: FullPermissionsOptions & {
			fullPermissions: GuildApplicationCommandPermissionData[];
		}
	): Promise<Collection<Snowflake, ApplicationCommandPermissions[]>>;
	private permissionsPath(guildId: Snowflake, commandId?: Snowflake): unknown;
	private static transformPermissions(permissions: ApplicationCommandPermissionData, received?: boolean): unknown;
}