@elara-services/packages 5.0.0 → 5.1.0
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.
- package/CHANGELOG +7 -0
- package/index.d.ts +5 -1
- package/package.json +1 -1
- package/packages/Interactions.js +1 -1
- package/packages/SlashBuilder.js +2 -2
package/CHANGELOG
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# v5.1.0
|
2
|
+
- Added `name_localizations` for `SlashBuilder.choice`
|
3
|
+
- Added typings for `min_length` and `max_length` for `SlashBuilder.option` for STRING options.
|
4
|
+
- Fixed typings for `Interactions.button` to have `label` and `title`
|
5
|
+
- Fixed `Interactions.button` to allow for `title` and `label`
|
6
|
+
|
7
|
+
|
1
8
|
# v5.0.0
|
2
9
|
### BREAKING CHANGES
|
3
10
|
- `locale` option for `SlashBuilder.context.user` and `SlashBuilder.context.message` was turned into `options` taking in more options (to support both permissions and locale)
|
package/index.d.ts
CHANGED
@@ -54,6 +54,8 @@ declare module "@elara-services/packages" {
|
|
54
54
|
autocomplete?: boolean;
|
55
55
|
min_value?: number;
|
56
56
|
max_value?: number;
|
57
|
+
min_length?: number;
|
58
|
+
max_length?: number;
|
57
59
|
choices?: { name: string, value: string }[];
|
58
60
|
options?: SlashOptions[];
|
59
61
|
locale?: {
|
@@ -104,7 +106,7 @@ declare module "@elara-services/packages" {
|
|
104
106
|
message(name: string, options?: Omit<Slash, "options"|"type">): Slash;
|
105
107
|
};
|
106
108
|
|
107
|
-
public static choice(name: string, value: string|number): { name: string, value: string|number };
|
109
|
+
public static choice(name: string, value: string|number, name_localizations?: object): { name: string, value: string|number, name_localizations: object };
|
108
110
|
public static option(data: SlashOptions): Slash;
|
109
111
|
public static create(name: string, description: string, options: Slash): Slash;
|
110
112
|
}
|
@@ -121,6 +123,8 @@ declare module "@elara-services/packages" {
|
|
121
123
|
|
122
124
|
export type ButtonOptions = {
|
123
125
|
id?: Button['custom_id'];
|
126
|
+
title?: Button['label'];
|
127
|
+
label?: Button['label'];
|
124
128
|
custom_id?: Button['custom_id'];
|
125
129
|
type?: Button['type'];
|
126
130
|
style?: ButtonStyles | Button['style'];
|
package/package.json
CHANGED
package/packages/Interactions.js
CHANGED
@@ -12,7 +12,7 @@ module.exports = class Interactions extends null {
|
|
12
12
|
}
|
13
13
|
return {
|
14
14
|
custom_id: options?.id ?? options?.custom_id ?? "",
|
15
|
-
label: options?.title ?? "",
|
15
|
+
label: options?.title ?? options?.label ?? "",
|
16
16
|
type: options?.type ?? 2,
|
17
17
|
style: options?.style ? options.style : 2,
|
18
18
|
disabled: Boolean(options.disabled),
|
package/packages/SlashBuilder.js
CHANGED
@@ -29,8 +29,8 @@ module.exports = class SlashBuilder extends null {
|
|
29
29
|
}
|
30
30
|
};
|
31
31
|
|
32
|
-
static choice(name, value) {
|
33
|
-
return { name, value };
|
32
|
+
static choice(name, value, name_localizations) {
|
33
|
+
return { name, value, name_localizations };
|
34
34
|
};
|
35
35
|
|
36
36
|
static option(data) {
|