@fallencodes/seyfert-utils 1.5.8 → 1.6.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActionBuilderComponents, ActionRow, Button, Container, ContainerBuilderComponents, FixedComponents, Section, Separator, TextDisplay } from 'seyfert';
|
|
1
|
+
import { ActionBuilderComponents, ActionRow, Button, Container, ContainerBuilderComponents, FixedComponents, MediaGallery, Section, Separator, StringSelectMenu, TextDisplay } from 'seyfert';
|
|
2
2
|
import { EmojiResolvable } from 'seyfert/lib/common/index.js';
|
|
3
3
|
import { ButtonStyle, Spacing } from 'seyfert/lib/types/index.js';
|
|
4
4
|
export declare function createTextDisplay(content: string): TextDisplay;
|
|
@@ -40,5 +40,26 @@ type ButtonData = (BaseButtonData & {
|
|
|
40
40
|
style: ButtonStyle;
|
|
41
41
|
});
|
|
42
42
|
export declare function createButton(data: ButtonData): Button;
|
|
43
|
+
interface StringSelectData {
|
|
44
|
+
customId: string;
|
|
45
|
+
minValues?: number;
|
|
46
|
+
maxValues?: number;
|
|
47
|
+
placeholder?: string;
|
|
48
|
+
options: StringSelectOptionData[];
|
|
49
|
+
}
|
|
50
|
+
interface StringSelectOptionData {
|
|
51
|
+
label: string;
|
|
52
|
+
value: string;
|
|
53
|
+
emoji?: EmojiResolvable;
|
|
54
|
+
default?: boolean;
|
|
55
|
+
description?: string;
|
|
56
|
+
}
|
|
57
|
+
export declare function createStringSelect(data: StringSelectData): ActionRow<StringSelectMenu>;
|
|
58
|
+
interface MediaGalleryItemData {
|
|
59
|
+
url: string;
|
|
60
|
+
spoiler?: boolean;
|
|
61
|
+
description?: string;
|
|
62
|
+
}
|
|
63
|
+
export declare function createMediaGallery(...items: MediaGalleryItemData[]): MediaGallery;
|
|
43
64
|
export {};
|
|
44
65
|
//# sourceMappingURL=message.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/components/message.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/components/message.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,uBAAuB,EACvB,SAAS,EACT,MAAM,EACN,SAAS,EACT,0BAA0B,EAC1B,eAAe,EACf,YAAY,EAEZ,OAAO,EACP,SAAS,EACT,gBAAgB,EAEhB,WAAW,EAEd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAElE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAE9D;AAED,KAAK,gBAAgB,GAAG,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC,GAAG,CAAC;IACF,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC,CAAA;AAEF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAqBvF;AAED,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,aAEnE;AAED,UAAU,gBAAgB;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBA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BAAoB;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,kBAAkB,CAAC,GAAG,KAAK,EAAE,oBAAoB,EAAE,gBAMlE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActionRow, Button, Container, Section, Separator, TextDisplay, Thumbnail } from 'seyfert';
|
|
1
|
+
import { ActionRow, Button, Container, MediaGallery, MediaGalleryItem, Section, Separator, StringSelectMenu, StringSelectOption, TextDisplay, Thumbnail } from 'seyfert';
|
|
2
2
|
export function createTextDisplay(content) {
|
|
3
3
|
return new TextDisplay({ content });
|
|
4
4
|
}
|
|
@@ -67,3 +67,32 @@ export function createButton(data) {
|
|
|
67
67
|
return button;
|
|
68
68
|
}
|
|
69
69
|
;
|
|
70
|
+
;
|
|
71
|
+
export function createStringSelect(data) {
|
|
72
|
+
const stringSelect = new StringSelectMenu({
|
|
73
|
+
custom_id: data.customId,
|
|
74
|
+
min_values: data.minValues,
|
|
75
|
+
max_values: data.maxValues,
|
|
76
|
+
placeholder: data.placeholder
|
|
77
|
+
}).setOptions(data.options.map((optionData) => {
|
|
78
|
+
const option = new StringSelectOption({
|
|
79
|
+
label: optionData.label,
|
|
80
|
+
value: optionData.value,
|
|
81
|
+
default: optionData.default,
|
|
82
|
+
description: optionData.description
|
|
83
|
+
});
|
|
84
|
+
if (optionData.emoji)
|
|
85
|
+
option.setEmoji(optionData.emoji);
|
|
86
|
+
return option;
|
|
87
|
+
}));
|
|
88
|
+
return createActionRow(stringSelect);
|
|
89
|
+
}
|
|
90
|
+
;
|
|
91
|
+
export function createMediaGallery(...items) {
|
|
92
|
+
return new MediaGallery().setItems(items.map((item) => new MediaGalleryItem({
|
|
93
|
+
media: { url: item.url },
|
|
94
|
+
spoiler: item.spoiler,
|
|
95
|
+
description: item.description
|
|
96
|
+
})));
|
|
97
|
+
}
|
|
98
|
+
;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fallencodes/seyfert-utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.6.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "A collection of various utility/helper code I use in my Seyfert projects.",
|
|
7
7
|
"main": "build/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"ms": "^2.1.3",
|
|
41
41
|
"multibyte": "^1.0.5",
|
|
42
42
|
"nanoid": "^5.1.6",
|
|
43
|
-
"seyfert": "4.
|
|
43
|
+
"seyfert": "4.3.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/ms": "^2.1.0",
|