@discordjs/rest 2.5.1 → 2.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.
package/dist/index.mjs CHANGED
@@ -86,7 +86,7 @@ import { CDNRoutes } from "discord-api-types/v10";
86
86
  // src/lib/utils/constants.ts
87
87
  import { getUserAgentAppendix } from "@discordjs/util";
88
88
  import { APIVersion } from "discord-api-types/v10";
89
- var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.5.1)`;
89
+ var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.6.0)`;
90
90
  var DefaultUserAgentAppendix = getUserAgentAppendix();
91
91
  var DefaultRestOptions = {
92
92
  agent: null,
@@ -502,6 +502,16 @@ var CDN = class {
502
502
  soundboardSound(soundId) {
503
503
  return `${this.cdn}${CDNRoutes.soundboardSound(soundId)}`;
504
504
  }
505
+ /**
506
+ * Generates a URL for a guild tag badge.
507
+ *
508
+ * @param guildId - The guild id
509
+ * @param badgeHash - The hash of the badge
510
+ * @param options - Optional options for the badge
511
+ */
512
+ guildTagBadge(guildId, badgeHash, options) {
513
+ return this.makeURL(`/guild-tag-badges/${guildId}/${badgeHash}`, options);
514
+ }
505
515
  /**
506
516
  * Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
507
517
  *
@@ -522,7 +532,8 @@ var CDN = class {
522
532
  allowedExtensions = ALLOWED_EXTENSIONS,
523
533
  base = this.cdn,
524
534
  extension = "webp",
525
- size
535
+ size,
536
+ animated
526
537
  } = {}) {
527
538
  extension = String(extension).toLowerCase();
528
539
  if (!allowedExtensions.includes(extension)) {
@@ -534,6 +545,9 @@ Must be one of: ${allowedExtensions.join(", ")}`);
534
545
  Must be one of: ${ALLOWED_SIZES.join(", ")}`);
535
546
  }
536
547
  const url = new URL(`${base}${route}.${extension}`);
548
+ if (animated !== void 0) {
549
+ url.searchParams.set("animated", String(animated));
550
+ }
537
551
  if (size) {
538
552
  url.searchParams.set("size", String(size));
539
553
  }
@@ -1428,7 +1442,7 @@ var REST = class _REST extends AsyncEventEmitter {
1428
1442
  };
1429
1443
 
1430
1444
  // src/shared.ts
1431
- var version = "2.5.1";
1445
+ var version = "2.6.0";
1432
1446
 
1433
1447
  // src/index.ts
1434
1448
  globalThis.FormData ??= FormData2;