@magicyan/discord 1.4.0 → 1.4.2
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/dist/functions/components/components.cjs +1 -1
- package/dist/functions/components/components.mjs +1 -1
- package/dist/functions/components/separator.cjs +1 -1
- package/dist/functions/components/separator.mjs +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ const text = require('./text.cjs');
|
|
|
8
8
|
const row = require('./row.cjs');
|
|
9
9
|
|
|
10
10
|
function createComponents(...data) {
|
|
11
|
-
return data.filter((value) => value !== null).map((component) => {
|
|
11
|
+
return data.filter((value) => value !== null && value !== void 0).map((component) => {
|
|
12
12
|
if (typeof component === "string") {
|
|
13
13
|
return text.createTextDisplay(component);
|
|
14
14
|
}
|
|
@@ -6,7 +6,7 @@ import { createTextDisplay } from './text.mjs';
|
|
|
6
6
|
import { createRow } from './row.mjs';
|
|
7
7
|
|
|
8
8
|
function createComponents(...data) {
|
|
9
|
-
return data.filter((value) => value !== null).map((component) => {
|
|
9
|
+
return data.filter((value) => value !== null && value !== void 0).map((component) => {
|
|
10
10
|
if (typeof component === "string") {
|
|
11
11
|
return createTextDisplay(component);
|
|
12
12
|
}
|
|
@@ -4,7 +4,7 @@ const discord_js = require('discord.js');
|
|
|
4
4
|
|
|
5
5
|
function createSeparator(data = {}) {
|
|
6
6
|
return new discord_js.SeparatorBuilder({
|
|
7
|
-
divider:
|
|
7
|
+
divider: data.divider,
|
|
8
8
|
spacing: data.large ? discord_js.SeparatorSpacingSize.Large : discord_js.SeparatorSpacingSize.Small
|
|
9
9
|
});
|
|
10
10
|
}
|
|
@@ -2,7 +2,7 @@ import { SeparatorBuilder, SeparatorSpacingSize } from 'discord.js';
|
|
|
2
2
|
|
|
3
3
|
function createSeparator(data = {}) {
|
|
4
4
|
return new SeparatorBuilder({
|
|
5
|
-
divider:
|
|
5
|
+
divider: data.divider,
|
|
6
6
|
spacing: data.large ? SeparatorSpacingSize.Large : SeparatorSpacingSize.Small
|
|
7
7
|
});
|
|
8
8
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -263,7 +263,7 @@ type MediaGallerySource = MediaGalleryItemData | string | Attachment | Attachmen
|
|
|
263
263
|
declare function createMediaGallery(...items: MediaGallerySource[]): MediaGalleryBuilder;
|
|
264
264
|
|
|
265
265
|
interface SeparatorData {
|
|
266
|
-
|
|
266
|
+
divider?: boolean;
|
|
267
267
|
large?: boolean;
|
|
268
268
|
}
|
|
269
269
|
/**
|
|
@@ -274,10 +274,10 @@ interface SeparatorData {
|
|
|
274
274
|
* visible separator with small spacing.
|
|
275
275
|
*
|
|
276
276
|
* **Parameters:**
|
|
277
|
-
* - `
|
|
277
|
+
* - `divider` (optional): If `false`, the separator divider will be disabled and won't be rendered. Default is `true`.
|
|
278
278
|
* - `large` (optional): If `true`, the separator will have a large spacing. Default is `false` (small spacing).
|
|
279
279
|
*
|
|
280
|
-
* @param data - An object containing the optional properties `
|
|
280
|
+
* @param data - An object containing the optional properties `divider` and `large` to configure the separator.
|
|
281
281
|
*
|
|
282
282
|
* @returns A {@link SeparatorBuilder} instance with the specified configuration.
|
|
283
283
|
*
|
|
@@ -286,8 +286,8 @@ interface SeparatorData {
|
|
|
286
286
|
* const separator = createSeparator();
|
|
287
287
|
*
|
|
288
288
|
* @example
|
|
289
|
-
* // Creating a disabled separator (not visible)
|
|
290
|
-
* const separator = createSeparator({
|
|
289
|
+
* // Creating a disabled separator divider (not visible)
|
|
290
|
+
* const separator = createSeparator({ divider: false });
|
|
291
291
|
*
|
|
292
292
|
* @example
|
|
293
293
|
* // Creating a separator with large spacing
|
|
@@ -397,8 +397,8 @@ declare function createSection(data: SectionData): SectionBuilder;
|
|
|
397
397
|
*/
|
|
398
398
|
declare function createTextDisplay(content: string, id?: number): TextDisplayBuilder;
|
|
399
399
|
|
|
400
|
-
type ComponentData = TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | MessageActionRowComponentBuilder[] | MessageActionRowComponentBuilder | AttachmentBuilder | AttachmentBuilder | string | null;
|
|
401
|
-
declare function createComponents(...data: (ComponentData | ContainerBuilder)[]): (_discordjs_builders.ButtonBuilder |
|
|
400
|
+
type ComponentData = TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | MessageActionRowComponentBuilder[] | MessageActionRowComponentBuilder | AttachmentBuilder | AttachmentBuilder | string | null | undefined;
|
|
401
|
+
declare function createComponents(...data: (ComponentData | ContainerBuilder)[]): (_discordjs_builders.ButtonBuilder | TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | ContainerBuilder)[];
|
|
402
402
|
|
|
403
403
|
type PresetColor = keyof typeof Colors;
|
|
404
404
|
interface ContainerData extends Omit<ContainerComponentData, "accentColor" | "type" | "components"> {
|
package/dist/index.d.mts
CHANGED
|
@@ -263,7 +263,7 @@ type MediaGallerySource = MediaGalleryItemData | string | Attachment | Attachmen
|
|
|
263
263
|
declare function createMediaGallery(...items: MediaGallerySource[]): MediaGalleryBuilder;
|
|
264
264
|
|
|
265
265
|
interface SeparatorData {
|
|
266
|
-
|
|
266
|
+
divider?: boolean;
|
|
267
267
|
large?: boolean;
|
|
268
268
|
}
|
|
269
269
|
/**
|
|
@@ -274,10 +274,10 @@ interface SeparatorData {
|
|
|
274
274
|
* visible separator with small spacing.
|
|
275
275
|
*
|
|
276
276
|
* **Parameters:**
|
|
277
|
-
* - `
|
|
277
|
+
* - `divider` (optional): If `false`, the separator divider will be disabled and won't be rendered. Default is `true`.
|
|
278
278
|
* - `large` (optional): If `true`, the separator will have a large spacing. Default is `false` (small spacing).
|
|
279
279
|
*
|
|
280
|
-
* @param data - An object containing the optional properties `
|
|
280
|
+
* @param data - An object containing the optional properties `divider` and `large` to configure the separator.
|
|
281
281
|
*
|
|
282
282
|
* @returns A {@link SeparatorBuilder} instance with the specified configuration.
|
|
283
283
|
*
|
|
@@ -286,8 +286,8 @@ interface SeparatorData {
|
|
|
286
286
|
* const separator = createSeparator();
|
|
287
287
|
*
|
|
288
288
|
* @example
|
|
289
|
-
* // Creating a disabled separator (not visible)
|
|
290
|
-
* const separator = createSeparator({
|
|
289
|
+
* // Creating a disabled separator divider (not visible)
|
|
290
|
+
* const separator = createSeparator({ divider: false });
|
|
291
291
|
*
|
|
292
292
|
* @example
|
|
293
293
|
* // Creating a separator with large spacing
|
|
@@ -397,8 +397,8 @@ declare function createSection(data: SectionData): SectionBuilder;
|
|
|
397
397
|
*/
|
|
398
398
|
declare function createTextDisplay(content: string, id?: number): TextDisplayBuilder;
|
|
399
399
|
|
|
400
|
-
type ComponentData = TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | MessageActionRowComponentBuilder[] | MessageActionRowComponentBuilder | AttachmentBuilder | AttachmentBuilder | string | null;
|
|
401
|
-
declare function createComponents(...data: (ComponentData | ContainerBuilder)[]): (_discordjs_builders.ButtonBuilder |
|
|
400
|
+
type ComponentData = TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | MessageActionRowComponentBuilder[] | MessageActionRowComponentBuilder | AttachmentBuilder | AttachmentBuilder | string | null | undefined;
|
|
401
|
+
declare function createComponents(...data: (ComponentData | ContainerBuilder)[]): (_discordjs_builders.ButtonBuilder | TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | ContainerBuilder)[];
|
|
402
402
|
|
|
403
403
|
type PresetColor = keyof typeof Colors;
|
|
404
404
|
interface ContainerData extends Omit<ContainerComponentData, "accentColor" | "type" | "components"> {
|
package/dist/index.d.ts
CHANGED
|
@@ -263,7 +263,7 @@ type MediaGallerySource = MediaGalleryItemData | string | Attachment | Attachmen
|
|
|
263
263
|
declare function createMediaGallery(...items: MediaGallerySource[]): MediaGalleryBuilder;
|
|
264
264
|
|
|
265
265
|
interface SeparatorData {
|
|
266
|
-
|
|
266
|
+
divider?: boolean;
|
|
267
267
|
large?: boolean;
|
|
268
268
|
}
|
|
269
269
|
/**
|
|
@@ -274,10 +274,10 @@ interface SeparatorData {
|
|
|
274
274
|
* visible separator with small spacing.
|
|
275
275
|
*
|
|
276
276
|
* **Parameters:**
|
|
277
|
-
* - `
|
|
277
|
+
* - `divider` (optional): If `false`, the separator divider will be disabled and won't be rendered. Default is `true`.
|
|
278
278
|
* - `large` (optional): If `true`, the separator will have a large spacing. Default is `false` (small spacing).
|
|
279
279
|
*
|
|
280
|
-
* @param data - An object containing the optional properties `
|
|
280
|
+
* @param data - An object containing the optional properties `divider` and `large` to configure the separator.
|
|
281
281
|
*
|
|
282
282
|
* @returns A {@link SeparatorBuilder} instance with the specified configuration.
|
|
283
283
|
*
|
|
@@ -286,8 +286,8 @@ interface SeparatorData {
|
|
|
286
286
|
* const separator = createSeparator();
|
|
287
287
|
*
|
|
288
288
|
* @example
|
|
289
|
-
* // Creating a disabled separator (not visible)
|
|
290
|
-
* const separator = createSeparator({
|
|
289
|
+
* // Creating a disabled separator divider (not visible)
|
|
290
|
+
* const separator = createSeparator({ divider: false });
|
|
291
291
|
*
|
|
292
292
|
* @example
|
|
293
293
|
* // Creating a separator with large spacing
|
|
@@ -397,8 +397,8 @@ declare function createSection(data: SectionData): SectionBuilder;
|
|
|
397
397
|
*/
|
|
398
398
|
declare function createTextDisplay(content: string, id?: number): TextDisplayBuilder;
|
|
399
399
|
|
|
400
|
-
type ComponentData = TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | MessageActionRowComponentBuilder[] | MessageActionRowComponentBuilder | AttachmentBuilder | AttachmentBuilder | string | null;
|
|
401
|
-
declare function createComponents(...data: (ComponentData | ContainerBuilder)[]): (_discordjs_builders.ButtonBuilder |
|
|
400
|
+
type ComponentData = TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | MessageActionRowComponentBuilder[] | MessageActionRowComponentBuilder | AttachmentBuilder | AttachmentBuilder | string | null | undefined;
|
|
401
|
+
declare function createComponents(...data: (ComponentData | ContainerBuilder)[]): (_discordjs_builders.ButtonBuilder | TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | ContainerBuilder)[];
|
|
402
402
|
|
|
403
403
|
type PresetColor = keyof typeof Colors;
|
|
404
404
|
interface ContainerData extends Omit<ContainerComponentData, "accentColor" | "type" | "components"> {
|