@jubbio/core 1.3.3 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/dist/Client.js +50 -10
  2. package/dist/rest/REST.d.ts +1 -0
  3. package/dist/rest/REST.js +1 -1
  4. package/dist/structures/Channel.d.ts +1 -1
  5. package/dist/structures/Channel.js +11 -4
  6. package/dist/structures/Guild.d.ts +1 -1
  7. package/dist/structures/Guild.js +7 -3
  8. package/dist/structures/Message.d.ts +2 -0
  9. package/dist/structures/Message.js +13 -33
  10. package/package.json +4 -14
  11. package/dist/cjs/Client.d.ts +0 -157
  12. package/dist/cjs/Client.js +0 -640
  13. package/dist/cjs/builders/ActionRowBuilder.d.ts +0 -53
  14. package/dist/cjs/builders/ActionRowBuilder.js +0 -68
  15. package/dist/cjs/builders/ButtonBuilder.d.ts +0 -77
  16. package/dist/cjs/builders/ButtonBuilder.js +0 -96
  17. package/dist/cjs/builders/EmbedBuilder.d.ts +0 -157
  18. package/dist/cjs/builders/EmbedBuilder.js +0 -208
  19. package/dist/cjs/builders/ModalBuilder.d.ts +0 -122
  20. package/dist/cjs/builders/ModalBuilder.js +0 -162
  21. package/dist/cjs/builders/SelectMenuBuilder.d.ts +0 -123
  22. package/dist/cjs/builders/SelectMenuBuilder.js +0 -165
  23. package/dist/cjs/builders/SlashCommandBuilder.d.ts +0 -197
  24. package/dist/cjs/builders/SlashCommandBuilder.js +0 -324
  25. package/dist/cjs/builders/index.d.ts +0 -9
  26. package/dist/cjs/builders/index.js +0 -26
  27. package/dist/cjs/enums.d.ts +0 -191
  28. package/dist/cjs/enums.js +0 -211
  29. package/dist/cjs/index.d.ts +0 -25
  30. package/dist/cjs/index.js +0 -130
  31. package/dist/cjs/managers/BaseManager.d.ts +0 -69
  32. package/dist/cjs/managers/BaseManager.js +0 -106
  33. package/dist/cjs/managers/ChannelManager.d.ts +0 -95
  34. package/dist/cjs/managers/ChannelManager.js +0 -205
  35. package/dist/cjs/managers/GuildMemberManager.d.ts +0 -74
  36. package/dist/cjs/managers/GuildMemberManager.js +0 -157
  37. package/dist/cjs/managers/RoleManager.d.ts +0 -84
  38. package/dist/cjs/managers/RoleManager.js +0 -207
  39. package/dist/cjs/managers/index.d.ts +0 -7
  40. package/dist/cjs/managers/index.js +0 -24
  41. package/dist/cjs/rest/REST.d.ts +0 -527
  42. package/dist/cjs/rest/REST.js +0 -904
  43. package/dist/cjs/rest/index.d.ts +0 -1
  44. package/dist/cjs/rest/index.js +0 -18
  45. package/dist/cjs/sharding/ShardingManager.d.ts +0 -179
  46. package/dist/cjs/sharding/ShardingManager.js +0 -375
  47. package/dist/cjs/sharding/index.d.ts +0 -4
  48. package/dist/cjs/sharding/index.js +0 -21
  49. package/dist/cjs/structures/Channel.d.ts +0 -122
  50. package/dist/cjs/structures/Channel.js +0 -240
  51. package/dist/cjs/structures/Collection.d.ts +0 -53
  52. package/dist/cjs/structures/Collection.js +0 -115
  53. package/dist/cjs/structures/Guild.d.ts +0 -59
  54. package/dist/cjs/structures/Guild.js +0 -94
  55. package/dist/cjs/structures/GuildMember.d.ts +0 -174
  56. package/dist/cjs/structures/GuildMember.js +0 -311
  57. package/dist/cjs/structures/Interaction.d.ts +0 -245
  58. package/dist/cjs/structures/Interaction.js +0 -450
  59. package/dist/cjs/structures/Message.d.ts +0 -98
  60. package/dist/cjs/structures/Message.js +0 -195
  61. package/dist/cjs/structures/User.d.ts +0 -37
  62. package/dist/cjs/structures/User.js +0 -65
  63. package/dist/cjs/structures/index.d.ts +0 -7
  64. package/dist/cjs/structures/index.js +0 -25
  65. package/dist/cjs/structures.d.ts +0 -1
  66. package/dist/cjs/structures.js +0 -19
  67. package/dist/cjs/types.d.ts +0 -255
  68. package/dist/cjs/types.js +0 -3
  69. package/dist/cjs/utils/BitField.d.ts +0 -66
  70. package/dist/cjs/utils/BitField.js +0 -138
  71. package/dist/cjs/utils/Collection.d.ts +0 -116
  72. package/dist/cjs/utils/Collection.js +0 -265
  73. package/dist/cjs/utils/Collector.d.ts +0 -152
  74. package/dist/cjs/utils/Collector.js +0 -314
  75. package/dist/cjs/utils/DataResolver.d.ts +0 -61
  76. package/dist/cjs/utils/DataResolver.js +0 -146
  77. package/dist/cjs/utils/Formatters.d.ts +0 -145
  78. package/dist/cjs/utils/Formatters.js +0 -213
  79. package/dist/cjs/utils/IntentsBitField.d.ts +0 -85
  80. package/dist/cjs/utils/IntentsBitField.js +0 -99
  81. package/dist/cjs/utils/Partials.d.ts +0 -104
  82. package/dist/cjs/utils/Partials.js +0 -148
  83. package/dist/cjs/utils/PermissionsBitField.d.ts +0 -118
  84. package/dist/cjs/utils/PermissionsBitField.js +0 -145
  85. package/dist/cjs/utils/SnowflakeUtil.d.ts +0 -63
  86. package/dist/cjs/utils/SnowflakeUtil.js +0 -93
  87. package/dist/cjs/utils/Sweepers.d.ts +0 -119
  88. package/dist/cjs/utils/Sweepers.js +0 -249
  89. package/dist/cjs/utils/index.d.ts +0 -13
  90. package/dist/cjs/utils/index.js +0 -30
  91. package/dist/esm/Client.js +0 -634
  92. package/dist/esm/builders/ActionRowBuilder.js +0 -64
  93. package/dist/esm/builders/ButtonBuilder.js +0 -92
  94. package/dist/esm/builders/EmbedBuilder.js +0 -204
  95. package/dist/esm/builders/ModalBuilder.js +0 -157
  96. package/dist/esm/builders/SelectMenuBuilder.js +0 -161
  97. package/dist/esm/builders/SlashCommandBuilder.js +0 -311
  98. package/dist/esm/builders/index.js +0 -10
  99. package/dist/esm/enums.js +0 -208
  100. package/dist/esm/index.js +0 -34
  101. package/dist/esm/managers/BaseManager.js +0 -100
  102. package/dist/esm/managers/ChannelManager.js +0 -200
  103. package/dist/esm/managers/GuildMemberManager.js +0 -153
  104. package/dist/esm/managers/RoleManager.js +0 -203
  105. package/dist/esm/managers/index.js +0 -8
  106. package/dist/esm/rest/REST.js +0 -900
  107. package/dist/esm/rest/index.js +0 -2
  108. package/dist/esm/sharding/ShardingManager.js +0 -366
  109. package/dist/esm/sharding/index.js +0 -5
  110. package/dist/esm/structures/Channel.js +0 -232
  111. package/dist/esm/structures/Collection.js +0 -111
  112. package/dist/esm/structures/Guild.js +0 -90
  113. package/dist/esm/structures/GuildMember.js +0 -306
  114. package/dist/esm/structures/Interaction.js +0 -438
  115. package/dist/esm/structures/Message.js +0 -191
  116. package/dist/esm/structures/User.js +0 -61
  117. package/dist/esm/structures/index.js +0 -9
  118. package/dist/esm/structures.js +0 -3
  119. package/dist/esm/types.js +0 -2
  120. package/dist/esm/utils/BitField.js +0 -134
  121. package/dist/esm/utils/Collection.js +0 -261
  122. package/dist/esm/utils/Collector.js +0 -305
  123. package/dist/esm/utils/DataResolver.js +0 -142
  124. package/dist/esm/utils/Formatters.js +0 -191
  125. package/dist/esm/utils/IntentsBitField.js +0 -93
  126. package/dist/esm/utils/Partials.js +0 -137
  127. package/dist/esm/utils/PermissionsBitField.js +0 -141
  128. package/dist/esm/utils/SnowflakeUtil.js +0 -89
  129. package/dist/esm/utils/Sweepers.js +0 -245
  130. package/dist/esm/utils/index.js +0 -14
@@ -1,53 +0,0 @@
1
- /**
2
- * ActionRowBuilder for creating component rows
3
- */
4
- import { APIButtonComponent } from './ButtonBuilder';
5
- import { APISelectMenuComponent } from './SelectMenuBuilder';
6
- export type APIActionRowComponent = APIButtonComponent | APISelectMenuComponent;
7
- export interface APIActionRow {
8
- type: 1;
9
- components: APIActionRowComponent[];
10
- }
11
- /**
12
- * A builder for creating action rows
13
- */
14
- export declare class ActionRowBuilder<T extends APIActionRowComponent = APIActionRowComponent> {
15
- readonly data: {
16
- type: 1;
17
- components: T[];
18
- };
19
- constructor(data?: Partial<APIActionRow>);
20
- /**
21
- * Adds components to this action row
22
- * @param components The components to add
23
- */
24
- addComponents(...components: (T | {
25
- toJSON(): T;
26
- })[]): this;
27
- /**
28
- * Sets the components of this action row
29
- * @param components The components to set
30
- */
31
- setComponents(...components: (T | {
32
- toJSON(): T;
33
- })[]): this;
34
- /**
35
- * Removes, replaces, or inserts components
36
- * @param index The index to start at
37
- * @param deleteCount The number of components to remove
38
- * @param components The components to insert
39
- */
40
- spliceComponents(index: number, deleteCount: number, ...components: (T | {
41
- toJSON(): T;
42
- })[]): this;
43
- /**
44
- * Returns the JSON representation of this action row
45
- */
46
- toJSON(): APIActionRow;
47
- /**
48
- * Creates a new action row builder from existing data
49
- * @param other The action row data to copy
50
- */
51
- static from<T extends APIActionRowComponent>(other: Partial<APIActionRow> | ActionRowBuilder<T>): ActionRowBuilder<T>;
52
- }
53
- export default ActionRowBuilder;
@@ -1,68 +0,0 @@
1
- "use strict";
2
- /**
3
- * ActionRowBuilder for creating component rows
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ActionRowBuilder = void 0;
7
- /**
8
- * A builder for creating action rows
9
- */
10
- class ActionRowBuilder {
11
- data;
12
- constructor(data = {}) {
13
- this.data = {
14
- type: 1,
15
- components: data.components || []
16
- };
17
- }
18
- /**
19
- * Adds components to this action row
20
- * @param components The components to add
21
- */
22
- addComponents(...components) {
23
- for (const component of components) {
24
- if ('toJSON' in component && typeof component.toJSON === 'function') {
25
- this.data.components.push(component.toJSON());
26
- }
27
- else {
28
- this.data.components.push(component);
29
- }
30
- }
31
- return this;
32
- }
33
- /**
34
- * Sets the components of this action row
35
- * @param components The components to set
36
- */
37
- setComponents(...components) {
38
- this.data.components = [];
39
- return this.addComponents(...components);
40
- }
41
- /**
42
- * Removes, replaces, or inserts components
43
- * @param index The index to start at
44
- * @param deleteCount The number of components to remove
45
- * @param components The components to insert
46
- */
47
- spliceComponents(index, deleteCount, ...components) {
48
- const resolved = components.map(c => 'toJSON' in c && typeof c.toJSON === 'function' ? c.toJSON() : c);
49
- this.data.components.splice(index, deleteCount, ...resolved);
50
- return this;
51
- }
52
- /**
53
- * Returns the JSON representation of this action row
54
- */
55
- toJSON() {
56
- return { ...this.data };
57
- }
58
- /**
59
- * Creates a new action row builder from existing data
60
- * @param other The action row data to copy
61
- */
62
- static from(other) {
63
- return new ActionRowBuilder(other instanceof ActionRowBuilder ? other.data : other);
64
- }
65
- }
66
- exports.ActionRowBuilder = ActionRowBuilder;
67
- exports.default = ActionRowBuilder;
68
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQWN0aW9uUm93QnVpbGRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9idWlsZGVycy9BY3Rpb25Sb3dCdWlsZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7R0FFRzs7O0FBWUg7O0dBRUc7QUFDSCxNQUFhLGdCQUFnQjtJQUNYLElBQUksQ0FBK0I7SUFFbkQsWUFBWSxPQUE4QixFQUFFO1FBQzFDLElBQUksQ0FBQyxJQUFJLEdBQUc7WUFDVixJQUFJLEVBQUUsQ0FBQztZQUNQLFVBQVUsRUFBRyxJQUFJLENBQUMsVUFBa0IsSUFBSSxFQUFFO1NBQzNDLENBQUM7SUFDSixDQUFDO0lBRUQ7OztPQUdHO0lBQ0gsYUFBYSxDQUFDLEdBQUcsVUFBbUM7UUFDbEQsS0FBSyxNQUFNLFNBQVMsSUFBSSxVQUFVLEVBQUUsQ0FBQztZQUNuQyxJQUFJLFFBQVEsSUFBSSxTQUFTLElBQUksT0FBTyxTQUFTLENBQUMsTUFBTSxLQUFLLFVBQVUsRUFBRSxDQUFDO2dCQUNwRSxJQUFJLENBQUMsSUFBSSxDQUFDLFVBQVUsQ0FBQyxJQUFJLENBQUMsU0FBUyxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUM7WUFDaEQsQ0FBQztpQkFBTSxDQUFDO2dCQUNOLElBQUksQ0FBQyxJQUFJLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxTQUFjLENBQUMsQ0FBQztZQUM1QyxDQUFDO1FBQ0gsQ0FBQztRQUNELE9BQU8sSUFBSSxDQUFDO0lBQ2QsQ0FBQztJQUVEOzs7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jtcbiJdfQ==
@@ -1,77 +0,0 @@
1
- /**
2
- * ButtonBuilder for creating interactive buttons
3
- */
4
- /**
5
- * Button styles
6
- */
7
- export declare enum ButtonStyle {
8
- Primary = 1,
9
- Secondary = 2,
10
- Success = 3,
11
- Danger = 4,
12
- Link = 5
13
- }
14
- export interface APIButtonComponent {
15
- type: 2;
16
- style: ButtonStyle;
17
- label?: string;
18
- emoji?: {
19
- id?: string;
20
- name?: string;
21
- animated?: boolean;
22
- };
23
- custom_id?: string;
24
- url?: string;
25
- disabled?: boolean;
26
- }
27
- /**
28
- * A builder for creating buttons
29
- */
30
- export declare class ButtonBuilder {
31
- readonly data: Partial<APIButtonComponent>;
32
- constructor(data?: Partial<APIButtonComponent>);
33
- /**
34
- * Sets the custom ID of this button
35
- * @param customId The custom ID
36
- */
37
- setCustomId(customId: string): this;
38
- /**
39
- * Sets the label of this button
40
- * @param label The label
41
- */
42
- setLabel(label: string): this;
43
- /**
44
- * Sets the style of this button
45
- * @param style The style
46
- */
47
- setStyle(style: ButtonStyle): this;
48
- /**
49
- * Sets the emoji of this button
50
- * @param emoji The emoji
51
- */
52
- setEmoji(emoji: {
53
- id?: string;
54
- name?: string;
55
- animated?: boolean;
56
- } | string): this;
57
- /**
58
- * Sets the URL of this button (only for Link style)
59
- * @param url The URL
60
- */
61
- setURL(url: string): this;
62
- /**
63
- * Sets whether this button is disabled
64
- * @param disabled Whether the button is disabled
65
- */
66
- setDisabled(disabled?: boolean): this;
67
- /**
68
- * Returns the JSON representation of this button
69
- */
70
- toJSON(): APIButtonComponent;
71
- /**
72
- * Creates a new button builder from existing data
73
- * @param other The button data to copy
74
- */
75
- static from(other: Partial<APIButtonComponent> | ButtonBuilder): ButtonBuilder;
76
- }
77
- export default ButtonBuilder;
@@ -1,96 +0,0 @@
1
- "use strict";
2
- /**
3
- * ButtonBuilder for creating interactive buttons
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ButtonBuilder = exports.ButtonStyle = void 0;
7
- /**
8
- * Button styles
9
- */
10
- var ButtonStyle;
11
- (function (ButtonStyle) {
12
- ButtonStyle[ButtonStyle["Primary"] = 1] = "Primary";
13
- ButtonStyle[ButtonStyle["Secondary"] = 2] = "Secondary";
14
- ButtonStyle[ButtonStyle["Success"] = 3] = "Success";
15
- ButtonStyle[ButtonStyle["Danger"] = 4] = "Danger";
16
- ButtonStyle[ButtonStyle["Link"] = 5] = "Link";
17
- })(ButtonStyle || (exports.ButtonStyle = ButtonStyle = {}));
18
- /**
19
- * A builder for creating buttons
20
- */
21
- class ButtonBuilder {
22
- data;
23
- constructor(data = {}) {
24
- this.data = { type: 2, ...data };
25
- }
26
- /**
27
- * Sets the custom ID of this button
28
- * @param customId The custom ID
29
- */
30
- setCustomId(customId) {
31
- this.data.custom_id = customId;
32
- return this;
33
- }
34
- /**
35
- * Sets the label of this button
36
- * @param label The label
37
- */
38
- setLabel(label) {
39
- this.data.label = label;
40
- return this;
41
- }
42
- /**
43
- * Sets the style of this button
44
- * @param style The style
45
- */
46
- setStyle(style) {
47
- this.data.style = style;
48
- return this;
49
- }
50
- /**
51
- * Sets the emoji of this button
52
- * @param emoji The emoji
53
- */
54
- setEmoji(emoji) {
55
- if (typeof emoji === 'string') {
56
- // Unicode emoji
57
- this.data.emoji = { name: emoji };
58
- }
59
- else {
60
- this.data.emoji = emoji;
61
- }
62
- return this;
63
- }
64
- /**
65
- * Sets the URL of this button (only for Link style)
66
- * @param url The URL
67
- */
68
- setURL(url) {
69
- this.data.url = url;
70
- return this;
71
- }
72
- /**
73
- * Sets whether this button is disabled
74
- * @param disabled Whether the button is disabled
75
- */
76
- setDisabled(disabled = true) {
77
- this.data.disabled = disabled;
78
- return this;
79
- }
80
- /**
81
- * Returns the JSON representation of this button
82
- */
83
- toJSON() {
84
- return { ...this.data };
85
- }
86
- /**
87
- * Creates a new button builder from existing data
88
- * @param other The button data to copy
89
- */
90
- static from(other) {
91
- return new ButtonBuilder(other instanceof ButtonBuilder ? other.data : other);
92
- }
93
- }
94
- exports.ButtonBuilder = ButtonBuilder;
95
- exports.default = ButtonBuilder;
96
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQnV0dG9uQnVpbGRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9idWlsZGVycy9CdXR0b25CdWlsZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7R0FFRzs7O0FBRUg7O0dBRUc7QUFDSCxJQUFZLFdBTVg7QUFORCxXQUFZLFdBQVc7SUFDckIsbURBQVcsQ0FBQTtJQUNYLHVEQUFhLENBQUE7SUFDYixtREFBVyxDQUFBO0lBQ1gsaURBQVUsQ0FBQTtJQUNWLDZDQUFRLENBQUE7QUFDVixDQUFDLEVBTlcsV0FBVywyQkFBWCxXQUFXLFFBTXRCO0FBWUQ7O0dBRUc7QUFDSCxNQUFhLGFBQWE7SUFDUixJQUFJLENBQThCO0lBRWxELFlBQVksT0FBb0MsRUFBRTtRQUNoRCxJQUFJLENBQUMsSUFBSSxHQUFHLEVBQUUsSUFBSSxFQUFFLENBQUMsRUFBRSxHQUFHLElBQUksRUFBRSxDQUFDO0lBQ25DLENBQUM7SUFFRDs7O09BR0c7SUFDSCxXQUFXLENBQUMsUUFBZ0I7UUFDMUIsSUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLEdBQUcsUUFBUSxDQUFDO1FBQy9CLE9BQU8sSUFBSSxDQUFDO0lBQ2QsQ0FBQztJQUVEOzs7T0FHRztJQUNILFFBQVEsQ0FBQyxLQUFhO1FBQ3BCLElBQUksQ0FBQyxJQUFJLENBQUMsS0FBSyxHQUFHLEtBQUssQ0FBQztRQUN4QixPQUFPLElBQUksQ0FBQztJQUNkLENBQUM7SUFFRDs7O09BR0c7SUFDSCxRQUFRLENBQUMsS0FBa0I7UUFDekIsSUFBSSxDQUFDLElBQUksQ0FBQyxLQUFLLEdB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1dHRvbkJ1aWxkZXI7XG4iXX0=
@@ -1,157 +0,0 @@
1
- /**
2
- * EmbedBuilder for creating rich embeds
3
- */
4
- export interface APIEmbedField {
5
- name: string;
6
- value: string;
7
- inline?: boolean;
8
- }
9
- export interface APIEmbedAuthor {
10
- name: string;
11
- url?: string;
12
- icon_url?: string;
13
- }
14
- export interface APIEmbedFooter {
15
- text: string;
16
- icon_url?: string;
17
- }
18
- export interface APIEmbedImage {
19
- url: string;
20
- height?: number;
21
- width?: number;
22
- }
23
- export interface APIEmbedThumbnail {
24
- url: string;
25
- height?: number;
26
- width?: number;
27
- }
28
- export interface APIEmbed {
29
- title?: string;
30
- description?: string;
31
- url?: string;
32
- timestamp?: string;
33
- color?: number;
34
- footer?: APIEmbedFooter;
35
- image?: APIEmbedImage;
36
- thumbnail?: APIEmbedThumbnail;
37
- author?: APIEmbedAuthor;
38
- fields?: APIEmbedField[];
39
- }
40
- /**
41
- * A builder for creating embeds
42
- */
43
- export declare class EmbedBuilder {
44
- readonly data: APIEmbed;
45
- constructor(data?: APIEmbed);
46
- /**
47
- * Sets the title of this embed
48
- * @param title The title
49
- */
50
- setTitle(title: string | null): this;
51
- /**
52
- * Sets the description of this embed
53
- * @param description The description
54
- */
55
- setDescription(description: string | null): this;
56
- /**
57
- * Sets the URL of this embed
58
- * @param url The URL
59
- */
60
- setURL(url: string | null): this;
61
- /**
62
- * Sets the timestamp of this embed
63
- * @param timestamp The timestamp or date
64
- */
65
- setTimestamp(timestamp?: Date | number | null): this;
66
- /**
67
- * Sets the color of this embed
68
- * @param color The color (number, hex string, or RGB array)
69
- */
70
- setColor(color: number | `#${string}` | [number, number, number] | null): this;
71
- /**
72
- * Sets the footer of this embed
73
- * @param options The footer options
74
- */
75
- setFooter(options: {
76
- text: string;
77
- iconURL?: string;
78
- } | null): this;
79
- /**
80
- * Sets the image of this embed
81
- * @param url The image URL
82
- */
83
- setImage(url: string | null): this;
84
- /**
85
- * Sets the thumbnail of this embed
86
- * @param url The thumbnail URL
87
- */
88
- setThumbnail(url: string | null): this;
89
- /**
90
- * Sets the author of this embed
91
- * @param options The author options
92
- */
93
- setAuthor(options: {
94
- name: string;
95
- iconURL?: string;
96
- url?: string;
97
- } | null): this;
98
- /**
99
- * Adds fields to this embed (max 25 fields per embed)
100
- * @param fields The fields to add
101
- */
102
- addFields(...fields: APIEmbedField[]): this;
103
- /**
104
- * Sets the fields of this embed (max 25 fields per embed)
105
- * @param fields The fields to set
106
- */
107
- setFields(...fields: APIEmbedField[]): this;
108
- /**
109
- * Removes, replaces, or inserts fields (max 25 fields per embed)
110
- * @param index The index to start at
111
- * @param deleteCount The number of fields to remove
112
- * @param fields The fields to insert
113
- */
114
- spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this;
115
- /**
116
- * Returns the JSON representation of this embed
117
- */
118
- toJSON(): APIEmbed;
119
- /**
120
- * Creates a new embed builder from existing data
121
- * @param other The embed data to copy
122
- */
123
- static from(other: APIEmbed | EmbedBuilder): EmbedBuilder;
124
- }
125
- export declare const Colors: {
126
- readonly Default: 0;
127
- readonly White: 16777215;
128
- readonly Aqua: 1752220;
129
- readonly Green: 5763719;
130
- readonly Blue: 3447003;
131
- readonly Yellow: 16705372;
132
- readonly Purple: 10181046;
133
- readonly LuminousVividPink: 15277667;
134
- readonly Fuchsia: 15418782;
135
- readonly Gold: 15844367;
136
- readonly Orange: 15105570;
137
- readonly Red: 15548997;
138
- readonly Grey: 9807270;
139
- readonly Navy: 3426654;
140
- readonly DarkAqua: 1146986;
141
- readonly DarkGreen: 2067276;
142
- readonly DarkBlue: 2123412;
143
- readonly DarkPurple: 7419530;
144
- readonly DarkVividPink: 11342935;
145
- readonly DarkGold: 12745742;
146
- readonly DarkOrange: 11027200;
147
- readonly DarkRed: 10038562;
148
- readonly DarkGrey: 9936031;
149
- readonly DarkerGrey: 8359053;
150
- readonly LightGrey: 12370112;
151
- readonly DarkNavy: 2899536;
152
- readonly Blurple: 5793266;
153
- readonly Greyple: 10070709;
154
- readonly DarkButNotBlack: 2895667;
155
- readonly NotQuiteBlack: 2303786;
156
- };
157
- export default EmbedBuilder;