@discordjs/builders 1.8.0 → 1.8.1-dev.1714910616-07c12101e

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/index.mjs CHANGED
@@ -1288,7 +1288,7 @@ var TextInputBuilder = class extends ComponentBuilder {
1288
1288
  };
1289
1289
  }
1290
1290
  /**
1291
- * {@inheritDoc Equatable.equals}
1291
+ * Whether this is equal to another structure.
1292
1292
  */
1293
1293
  equals(other) {
1294
1294
  if (isJSONEncodable(other)) {
@@ -1697,6 +1697,84 @@ var SharedNameAndDescription = class {
1697
1697
  }
1698
1698
  };
1699
1699
 
1700
+ // src/interactions/slashCommands/mixins/SharedSlashCommand.ts
1701
+ var SharedSlashCommand = class {
1702
+ static {
1703
+ __name(this, "SharedSlashCommand");
1704
+ }
1705
+ name = void 0;
1706
+ name_localizations;
1707
+ description = void 0;
1708
+ description_localizations;
1709
+ options = [];
1710
+ /**
1711
+ * Sets whether the command is enabled by default when the application is added to a guild.
1712
+ *
1713
+ * @remarks
1714
+ * If set to `false`, you will have to later `PUT` the permissions for this command.
1715
+ * @param value - Whether or not to enable this command by default
1716
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#permissions}
1717
+ * @deprecated Use {@link SharedSlashCommand.setDefaultMemberPermissions} or {@link SharedSlashCommand.setDMPermission} instead.
1718
+ */
1719
+ setDefaultPermission(value) {
1720
+ validateDefaultPermission(value);
1721
+ Reflect.set(this, "default_permission", value);
1722
+ return this;
1723
+ }
1724
+ /**
1725
+ * Sets the default permissions a member should have in order to run the command.
1726
+ *
1727
+ * @remarks
1728
+ * You can set this to `'0'` to disable the command by default.
1729
+ * @param permissions - The permissions bit field to set
1730
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#permissions}
1731
+ */
1732
+ setDefaultMemberPermissions(permissions) {
1733
+ const permissionValue = validateDefaultMemberPermissions(permissions);
1734
+ Reflect.set(this, "default_member_permissions", permissionValue);
1735
+ return this;
1736
+ }
1737
+ /**
1738
+ * Sets if the command is available in direct messages with the application.
1739
+ *
1740
+ * @remarks
1741
+ * By default, commands are visible. This method is only for global commands.
1742
+ * @param enabled - Whether the command should be enabled in direct messages
1743
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#permissions}
1744
+ */
1745
+ setDMPermission(enabled) {
1746
+ validateDMPermission(enabled);
1747
+ Reflect.set(this, "dm_permission", enabled);
1748
+ return this;
1749
+ }
1750
+ /**
1751
+ * Sets whether this command is NSFW.
1752
+ *
1753
+ * @param nsfw - Whether this command is NSFW
1754
+ */
1755
+ setNSFW(nsfw = true) {
1756
+ validateNSFW(nsfw);
1757
+ Reflect.set(this, "nsfw", nsfw);
1758
+ return this;
1759
+ }
1760
+ /**
1761
+ * Serializes this builder to API-compatible JSON data.
1762
+ *
1763
+ * @remarks
1764
+ * This method runs validations on the data before serializing it.
1765
+ * As such, it may throw an error if the data is invalid.
1766
+ */
1767
+ toJSON() {
1768
+ validateRequiredParameters3(this.name, this.description, this.options);
1769
+ validateLocalizationMap(this.name_localizations);
1770
+ validateLocalizationMap(this.description_localizations);
1771
+ return {
1772
+ ...this,
1773
+ options: this.options.map((option) => option.toJSON())
1774
+ };
1775
+ }
1776
+ };
1777
+
1700
1778
  // src/interactions/slashCommands/options/attachment.ts
1701
1779
  import { ApplicationCommandOptionType } from "discord-api-types/v10";
1702
1780
 
@@ -2340,61 +2418,7 @@ var SharedSlashCommandSubcommands = class {
2340
2418
  static {
2341
2419
  __name(this, "SharedSlashCommandSubcommands");
2342
2420
  }
2343
- name = void 0;
2344
- name_localizations;
2345
- description = void 0;
2346
- description_localizations;
2347
2421
  options = [];
2348
- /**
2349
- * Sets whether the command is enabled by default when the application is added to a guild.
2350
- *
2351
- * @remarks
2352
- * If set to `false`, you will have to later `PUT` the permissions for this command.
2353
- * @param value - Whether or not to enable this command by default
2354
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#permissions}
2355
- * @deprecated Use {@link SharedSlashCommandSubcommands.setDefaultMemberPermissions} or {@link SharedSlashCommandSubcommands.setDMPermission} instead.
2356
- */
2357
- setDefaultPermission(value) {
2358
- validateDefaultPermission(value);
2359
- Reflect.set(this, "default_permission", value);
2360
- return this;
2361
- }
2362
- /**
2363
- * Sets the default permissions a member should have in order to run the command.
2364
- *
2365
- * @remarks
2366
- * You can set this to `'0'` to disable the command by default.
2367
- * @param permissions - The permissions bit field to set
2368
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#permissions}
2369
- */
2370
- setDefaultMemberPermissions(permissions) {
2371
- const permissionValue = validateDefaultMemberPermissions(permissions);
2372
- Reflect.set(this, "default_member_permissions", permissionValue);
2373
- return this;
2374
- }
2375
- /**
2376
- * Sets if the command is available in direct messages with the application.
2377
- *
2378
- * @remarks
2379
- * By default, commands are visible. This method is only for global commands.
2380
- * @param enabled - Whether the command should be enabled in direct messages
2381
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#permissions}
2382
- */
2383
- setDMPermission(enabled) {
2384
- validateDMPermission(enabled);
2385
- Reflect.set(this, "dm_permission", enabled);
2386
- return this;
2387
- }
2388
- /**
2389
- * Sets whether this command is NSFW.
2390
- *
2391
- * @param nsfw - Whether this command is NSFW
2392
- */
2393
- setNSFW(nsfw = true) {
2394
- validateNSFW(nsfw);
2395
- Reflect.set(this, "nsfw", nsfw);
2396
- return this;
2397
- }
2398
2422
  /**
2399
2423
  * Adds a new subcommand group to this command.
2400
2424
  *
@@ -2421,22 +2445,6 @@ var SharedSlashCommandSubcommands = class {
2421
2445
  options.push(result);
2422
2446
  return this;
2423
2447
  }
2424
- /**
2425
- * Serializes this builder to API-compatible JSON data.
2426
- *
2427
- * @remarks
2428
- * This method runs validations on the data before serializing it.
2429
- * As such, it may throw an error if the data is invalid.
2430
- */
2431
- toJSON() {
2432
- validateRequiredParameters3(this.name, this.description, this.options);
2433
- validateLocalizationMap(this.name_localizations);
2434
- validateLocalizationMap(this.description_localizations);
2435
- return {
2436
- ...this,
2437
- options: this.options.map((option) => option.toJSON())
2438
- };
2439
- }
2440
2448
  };
2441
2449
 
2442
2450
  // src/interactions/slashCommands/SlashCommandBuilder.ts
@@ -2464,7 +2472,7 @@ var SlashCommandBuilder = class {
2464
2472
  /**
2465
2473
  * Whether this command is enabled by default when the application is added to a guild.
2466
2474
  *
2467
- * @deprecated Use {@link SharedSlashCommandSubcommands.setDefaultMemberPermissions} or {@link SharedSlashCommandSubcommands.setDMPermission} instead.
2475
+ * @deprecated Use {@link SharedSlashCommand.setDefaultMemberPermissions} or {@link SharedSlashCommand.setDMPermission} instead.
2468
2476
  */
2469
2477
  default_permission = void 0;
2470
2478
  /**
@@ -2485,7 +2493,7 @@ var SlashCommandBuilder = class {
2485
2493
  };
2486
2494
  __name(SlashCommandBuilder, "SlashCommandBuilder");
2487
2495
  SlashCommandBuilder = __decorateClass([
2488
- mix6(SharedSlashCommandOptions, SharedNameAndDescription, SharedSlashCommandSubcommands)
2496
+ mix6(SharedSlashCommandOptions, SharedNameAndDescription, SharedSlashCommandSubcommands, SharedSlashCommand)
2489
2497
  ], SlashCommandBuilder);
2490
2498
 
2491
2499
  // src/interactions/contextMenuCommands/Assertions.ts
@@ -2684,7 +2692,7 @@ function embedLength(data) {
2684
2692
  __name(embedLength, "embedLength");
2685
2693
 
2686
2694
  // src/index.ts
2687
- var version = "1.8.0";
2695
+ var version = "1.8.1-dev.1714910616-07c12101e";
2688
2696
  export {
2689
2697
  ActionRowBuilder,
2690
2698
  ApplicationCommandNumericOptionMinMaxValueMixin,
@@ -2708,6 +2716,7 @@ export {
2708
2716
  StringSelectMenuBuilder as SelectMenuBuilder,
2709
2717
  StringSelectMenuOptionBuilder as SelectMenuOptionBuilder,
2710
2718
  SharedNameAndDescription,
2719
+ SharedSlashCommand,
2711
2720
  SharedSlashCommandOptions,
2712
2721
  SharedSlashCommandSubcommands,
2713
2722
  Assertions_exports5 as SlashCommandAssertions,