@magicyan/discord 1.4.9 → 1.4.10
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.
|
@@ -6,9 +6,10 @@ const selectmenu = require('../../guards/selectmenu.cjs');
|
|
|
6
6
|
const gallery = require('./gallery.cjs');
|
|
7
7
|
const row = require('./row.cjs');
|
|
8
8
|
const text = require('./text.cjs');
|
|
9
|
+
const core = require('@magicyan/core');
|
|
9
10
|
|
|
10
11
|
function createComponents(...data) {
|
|
11
|
-
return data.flat().filter((value) => value
|
|
12
|
+
return data.flat().filter((value) => core.isDefined(value)).filter((value) => typeof value !== "boolean").map((component) => {
|
|
12
13
|
if (typeof component === "string") {
|
|
13
14
|
return text.createTextDisplay(component);
|
|
14
15
|
}
|
|
@@ -4,9 +4,10 @@ import { isAnySelectMenuBuilder } from '../../guards/selectmenu.mjs';
|
|
|
4
4
|
import { createMediaGallery } from './gallery.mjs';
|
|
5
5
|
import { createRow } from './row.mjs';
|
|
6
6
|
import { createTextDisplay } from './text.mjs';
|
|
7
|
+
import { isDefined } from '@magicyan/core';
|
|
7
8
|
|
|
8
9
|
function createComponents(...data) {
|
|
9
|
-
return data.flat().filter((value) => value
|
|
10
|
+
return data.flat().filter((value) => isDefined(value)).filter((value) => typeof value !== "boolean").map((component) => {
|
|
10
11
|
if (typeof component === "string") {
|
|
11
12
|
return createTextDisplay(component);
|
|
12
13
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -546,9 +546,9 @@ type ThumbAreaData = {
|
|
|
546
546
|
declare function createThumbArea(content: string, thumbnail?: ThumbAreaThumbnail): SectionBuilder | TextDisplayBuilder;
|
|
547
547
|
declare function createThumbArea(data: ThumbAreaData): SectionBuilder | TextDisplayBuilder;
|
|
548
548
|
|
|
549
|
-
type ComponentData = TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | MessageActionRowComponentBuilder[] | MessageActionRowComponentBuilder | Attachment | AttachmentBuilder | string | null | undefined;
|
|
549
|
+
type ComponentData = TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | MessageActionRowComponentBuilder[] | MessageActionRowComponentBuilder | Attachment | AttachmentBuilder | string | null | undefined | boolean;
|
|
550
550
|
type CreateComponentData = ComponentData | ContainerBuilder;
|
|
551
|
-
declare function createComponents(...data: (CreateComponentData | CreateComponentData[])[]): (
|
|
551
|
+
declare function createComponents(...data: (CreateComponentData | CreateComponentData[])[]): (SeparatorBuilder | TextDisplayBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | ContainerBuilder)[];
|
|
552
552
|
|
|
553
553
|
type ContainerColor = (string & {}) | ColorResolvable;
|
|
554
554
|
interface ContainerData extends Omit<ContainerComponentData, "accentColor" | "type" | "components"> {
|
package/dist/index.d.mts
CHANGED
|
@@ -546,9 +546,9 @@ type ThumbAreaData = {
|
|
|
546
546
|
declare function createThumbArea(content: string, thumbnail?: ThumbAreaThumbnail): SectionBuilder | TextDisplayBuilder;
|
|
547
547
|
declare function createThumbArea(data: ThumbAreaData): SectionBuilder | TextDisplayBuilder;
|
|
548
548
|
|
|
549
|
-
type ComponentData = TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | MessageActionRowComponentBuilder[] | MessageActionRowComponentBuilder | Attachment | AttachmentBuilder | string | null | undefined;
|
|
549
|
+
type ComponentData = TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | MessageActionRowComponentBuilder[] | MessageActionRowComponentBuilder | Attachment | AttachmentBuilder | string | null | undefined | boolean;
|
|
550
550
|
type CreateComponentData = ComponentData | ContainerBuilder;
|
|
551
|
-
declare function createComponents(...data: (CreateComponentData | CreateComponentData[])[]): (
|
|
551
|
+
declare function createComponents(...data: (CreateComponentData | CreateComponentData[])[]): (SeparatorBuilder | TextDisplayBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | ContainerBuilder)[];
|
|
552
552
|
|
|
553
553
|
type ContainerColor = (string & {}) | ColorResolvable;
|
|
554
554
|
interface ContainerData extends Omit<ContainerComponentData, "accentColor" | "type" | "components"> {
|
package/dist/index.d.ts
CHANGED
|
@@ -546,9 +546,9 @@ type ThumbAreaData = {
|
|
|
546
546
|
declare function createThumbArea(content: string, thumbnail?: ThumbAreaThumbnail): SectionBuilder | TextDisplayBuilder;
|
|
547
547
|
declare function createThumbArea(data: ThumbAreaData): SectionBuilder | TextDisplayBuilder;
|
|
548
548
|
|
|
549
|
-
type ComponentData = TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | MessageActionRowComponentBuilder[] | MessageActionRowComponentBuilder | Attachment | AttachmentBuilder | string | null | undefined;
|
|
549
|
+
type ComponentData = TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | MessageActionRowComponentBuilder[] | MessageActionRowComponentBuilder | Attachment | AttachmentBuilder | string | null | undefined | boolean;
|
|
550
550
|
type CreateComponentData = ComponentData | ContainerBuilder;
|
|
551
|
-
declare function createComponents(...data: (CreateComponentData | CreateComponentData[])[]): (
|
|
551
|
+
declare function createComponents(...data: (CreateComponentData | CreateComponentData[])[]): (SeparatorBuilder | TextDisplayBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | ContainerBuilder)[];
|
|
552
552
|
|
|
553
553
|
type ContainerColor = (string & {}) | ColorResolvable;
|
|
554
554
|
interface ContainerData extends Omit<ContainerComponentData, "accentColor" | "type" | "components"> {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magicyan/discord",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.10",
|
|
4
4
|
"description": "Simple functions to facilitate discord bot development",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -49,6 +49,6 @@
|
|
|
49
49
|
"vitest": "^2.1.9"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@magicyan/core": "^1.1.
|
|
52
|
+
"@magicyan/core": "^1.1.1"
|
|
53
53
|
}
|
|
54
54
|
}
|