@discordjs/rest 2.3.1-dev.1716768619-d22b55fc8 → 2.4.0-dev.1717373417-94cc02a25
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.d.mts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -11
- package/dist/index.mjs.map +1 -1
- package/dist/web.d.mts +7 -0
- package/dist/web.d.ts +7 -0
- package/dist/web.js +7 -11
- package/dist/web.js.map +1 -1
- package/dist/web.mjs +7 -11
- package/dist/web.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -511,9 +511,16 @@ declare class CDN {
|
|
|
511
511
|
* @param options - Optional options for the avatar
|
|
512
512
|
*/
|
|
513
513
|
avatar(id: string, avatarHash: string, options?: Readonly<ImageURLOptions>): string;
|
|
514
|
+
/**
|
|
515
|
+
* Generates a user avatar decoration preset URL.
|
|
516
|
+
*
|
|
517
|
+
* @param asset - The avatar decoration hash
|
|
518
|
+
*/
|
|
519
|
+
avatarDecoration(asset: string): string;
|
|
514
520
|
/**
|
|
515
521
|
* Generates a user avatar decoration URL.
|
|
516
522
|
*
|
|
523
|
+
* @deprecated This overload is deprecated. Pass a hash instead.
|
|
517
524
|
* @param userId - The id of the user
|
|
518
525
|
* @param userAvatarDecoration - The hash provided by Discord for this avatar decoration
|
|
519
526
|
* @param options - Optional options for the avatar decoration
|
package/dist/index.d.ts
CHANGED
|
@@ -511,9 +511,16 @@ declare class CDN {
|
|
|
511
511
|
* @param options - Optional options for the avatar
|
|
512
512
|
*/
|
|
513
513
|
avatar(id: string, avatarHash: string, options?: Readonly<ImageURLOptions>): string;
|
|
514
|
+
/**
|
|
515
|
+
* Generates a user avatar decoration preset URL.
|
|
516
|
+
*
|
|
517
|
+
* @param asset - The avatar decoration hash
|
|
518
|
+
*/
|
|
519
|
+
avatarDecoration(asset: string): string;
|
|
514
520
|
/**
|
|
515
521
|
* Generates a user avatar decoration URL.
|
|
516
522
|
*
|
|
523
|
+
* @deprecated This overload is deprecated. Pass a hash instead.
|
|
517
524
|
* @param userId - The id of the user
|
|
518
525
|
* @param userAvatarDecoration - The hash provided by Discord for this avatar decoration
|
|
519
526
|
* @param options - Optional options for the avatar decoration
|
package/dist/index.js
CHANGED
|
@@ -124,7 +124,7 @@ __name(resolveBody, "resolveBody");
|
|
|
124
124
|
// src/lib/utils/constants.ts
|
|
125
125
|
var import_util = require("@discordjs/util");
|
|
126
126
|
var import_v10 = require("discord-api-types/v10");
|
|
127
|
-
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.
|
|
127
|
+
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.4.0-dev.1717373417-94cc02a25)`;
|
|
128
128
|
var DefaultUserAgentAppendix = (0, import_util.getUserAgentAppendix)();
|
|
129
129
|
var DefaultRestOptions = {
|
|
130
130
|
agent: null,
|
|
@@ -369,15 +369,11 @@ var CDN = class {
|
|
|
369
369
|
avatar(id, avatarHash, options) {
|
|
370
370
|
return this.dynamicMakeURL(`/avatars/${id}/${avatarHash}`, avatarHash, options);
|
|
371
371
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
* @param options - Optional options for the avatar decoration
|
|
378
|
-
*/
|
|
379
|
-
avatarDecoration(userId, userAvatarDecoration, options) {
|
|
380
|
-
return this.makeURL(`/avatar-decorations/${userId}/${userAvatarDecoration}`, options);
|
|
372
|
+
avatarDecoration(userIdOrAsset, userAvatarDecoration, options) {
|
|
373
|
+
if (userAvatarDecoration) {
|
|
374
|
+
return this.makeURL(`/avatar-decorations/${userIdOrAsset}/${userAvatarDecoration}`, options);
|
|
375
|
+
}
|
|
376
|
+
return this.makeURL(`/avatar-decoration-presets/${userIdOrAsset}`, { extension: "png" });
|
|
381
377
|
}
|
|
382
378
|
/**
|
|
383
379
|
* Generates a banner URL, e.g. for a user or a guild.
|
|
@@ -1454,7 +1450,7 @@ var REST = class _REST extends import_async_event_emitter.AsyncEventEmitter {
|
|
|
1454
1450
|
};
|
|
1455
1451
|
|
|
1456
1452
|
// src/shared.ts
|
|
1457
|
-
var version = "2.
|
|
1453
|
+
var version = "2.4.0-dev.1717373417-94cc02a25";
|
|
1458
1454
|
|
|
1459
1455
|
// src/index.ts
|
|
1460
1456
|
globalThis.FormData ??= import_undici2.FormData;
|