@magicyan/discord 1.4.0 → 1.4.1

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.
@@ -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: !data.disabled,
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: !data.disabled,
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
- disabled?: boolean;
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
- * - `disabled` (optional): If `true`, the separator will be disabled and won't be rendered. Default is `false`.
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 `disabled` and `large` to configure the separator.
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({ disabled: true });
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 | SeparatorBuilder | TextDisplayBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | ContainerBuilder)[];
400
+ type ComponentData = TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | MessageActionRowComponentBuilder[] | MessageActionRowComponentBuilder | AttachmentBuilder | AttachmentBuilder | string | null | undefined;
401
+ declare function createComponents(...data: (ComponentData | ContainerBuilder)[]): (TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | _discordjs_builders.ButtonBuilder | ContainerBuilder | undefined)[];
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
- disabled?: boolean;
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
- * - `disabled` (optional): If `true`, the separator will be disabled and won't be rendered. Default is `false`.
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 `disabled` and `large` to configure the separator.
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({ disabled: true });
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 | SeparatorBuilder | TextDisplayBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | ContainerBuilder)[];
400
+ type ComponentData = TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | MessageActionRowComponentBuilder[] | MessageActionRowComponentBuilder | AttachmentBuilder | AttachmentBuilder | string | null | undefined;
401
+ declare function createComponents(...data: (ComponentData | ContainerBuilder)[]): (TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | _discordjs_builders.ButtonBuilder | ContainerBuilder | undefined)[];
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
- disabled?: boolean;
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
- * - `disabled` (optional): If `true`, the separator will be disabled and won't be rendered. Default is `false`.
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 `disabled` and `large` to configure the separator.
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({ disabled: true });
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 | SeparatorBuilder | TextDisplayBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | ContainerBuilder)[];
400
+ type ComponentData = TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | MessageActionRowComponentBuilder[] | MessageActionRowComponentBuilder | AttachmentBuilder | AttachmentBuilder | string | null | undefined;
401
+ declare function createComponents(...data: (ComponentData | ContainerBuilder)[]): (TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder> | _discordjs_builders.ButtonBuilder | ContainerBuilder | undefined)[];
402
402
 
403
403
  type PresetColor = keyof typeof Colors;
404
404
  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.0",
3
+ "version": "1.4.1",
4
4
  "description": "Simple functions to facilitate discord bot development",
5
5
  "license": "MIT",
6
6
  "type": "module",