aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord.js/BushGuildEmojiRoleManager.ts
blob: 8b069ae66309156bf9787cf2362ca7bc99df3142 (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
55
import type { BushClient, BushGuild, BushGuildEmoji, BushRole, BushRoleResolvable } from '#lib';
import { DataManager, GuildEmojiRoleManager, type Collection, type Snowflake } from 'discord.js';

/**
 * Manages API methods for roles belonging to emojis and stores their cache.
 */
export declare class BushGuildEmojiRoleManager
	extends DataManager<Snowflake, BushRole, BushRoleResolvable>
	implements GuildEmojiRoleManager
{
	public constructor(emoji: BushGuildEmoji);
	public declare readonly client: BushClient;

	/**
	 * The emoji belonging to this manager
	 */
	public emoji: BushGuildEmoji;

	/**
	 * The guild belonging to this manager
	 */
	public guild: BushGuild;

	/**
	 * Adds a role (or multiple roles) to the list of roles that can use this emoji.
	 * @param roleOrRoles The role or roles to add
	 */
	public add(
		roleOrRoles: BushRoleResolvable | readonly BushRoleResolvable[] | Collection<Snowflake, BushRole>
	): Promise<BushGuildEmoji>;

	/**
	 * Sets the role(s) that can use this emoji.
	 * @param roles The roles or role ids to apply
	 * @example
	 * // Set the emoji's roles to a single role
	 * guildEmoji.roles.set(['391156570408615936'])
	 *   .then(console.log)
	 *   .catch(console.error);
	 * @example
	 * // Remove all roles from an emoji
	 * guildEmoji.roles.set([])
	 *    .then(console.log)
	 *    .catch(console.error);
	 */
	public set(roles: readonly BushRoleResolvable[] | Collection<Snowflake, BushRole>): Promise<BushGuildEmoji>;

	/**
	 * Removes a role (or multiple roles) from the list of roles that can use this emoji.
	 * @param roleOrRoles The role or roles to remove
	 */
	public remove(
		roleOrRoles: BushRoleResolvable | readonly BushRoleResolvable[] | Collection<Snowflake, BushRole>
	): Promise<BushGuildEmoji>;
}