J'ai juste update le cutie.js, CONNARD
Ah oui, j'ai aussi add le info.js, qui est merdique d'ailleurs
This commit is contained in:
Syxpi
2025-10-11 22:06:46 +02:00
parent 14d4df5a40
commit b5cba1c318
283 changed files with 15040 additions and 12924 deletions

View File

@@ -446,26 +446,40 @@ declare const BurstHandlerMajorIdKey = "burst";
declare const DEPRECATION_WARNING_PREFIX: "DeprecationWarning";
/**
* The options used for image URLs
* The options used for image URLs.
*/
interface BaseImageURLOptions {
/**
* The extension to use for the image URL
* The extension to use for the image URL.
*
* @defaultValue `'webp'`
*/
extension?: ImageExtension;
/**
* The size specified in the image URL
* The size specified in the image URL.
*/
size?: ImageSize;
}
interface EmojiURLOptionsWebp extends BaseImageURLOptions {
/**
* Whether to use the `animated` query parameter.
*/
animated?: boolean;
extension?: 'webp';
}
interface EmojiURLOptionsNotWebp extends BaseImageURLOptions {
extension: Exclude<ImageExtension, 'webp'>;
}
/**
* The options used for image URLs with animated content
* The options used for emoji URLs.
*/
type EmojiURLOptions = EmojiURLOptionsNotWebp | EmojiURLOptionsWebp;
/**
* The options used for image URLs that may be animated.
*/
interface ImageURLOptions extends BaseImageURLOptions {
/**
* Whether or not to prefer the static version of an image asset.
* Whether to prefer the static asset.
*/
forceStatic?: boolean;
}
@@ -477,6 +491,10 @@ interface MakeURLOptions {
* The allowed extensions that can be used
*/
allowedExtensions?: readonly string[];
/**
* Whether to use the `animated` query parameter
*/
animated?: boolean;
/**
* The base URL.
*
@@ -579,7 +597,7 @@ declare class CDN {
* @param emojiId - The emoji id
* @param options - Optional options for the emoji
*/
emoji(emojiId: string, options?: Readonly<BaseImageURLOptions>): string;
emoji(emojiId: string, options?: Readonly<EmojiURLOptions>): string;
/**
* Generates an emoji's URL for an emoji.
*
@@ -669,6 +687,14 @@ declare class CDN {
* @param soundId - The soundboard sound id
*/
soundboardSound(soundId: string): string;
/**
* Generates a URL for a guild tag badge.
*
* @param guildId - The guild id
* @param badgeHash - The hash of the badge
* @param options - Optional options for the badge
*/
guildTagBadge(guildId: string, badgeHash: string, options?: Readonly<BaseImageURLOptions>): string;
/**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
*
@@ -929,4 +955,4 @@ declare function calculateUserDefaultAvatarIndex(userId: Snowflake): number;
*/
declare const version: string;
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version };
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type EmojiURLOptions, type EmojiURLOptionsNotWebp, type EmojiURLOptionsWebp, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version };

View File

@@ -446,26 +446,40 @@ declare const BurstHandlerMajorIdKey = "burst";
declare const DEPRECATION_WARNING_PREFIX: "DeprecationWarning";
/**
* The options used for image URLs
* The options used for image URLs.
*/
interface BaseImageURLOptions {
/**
* The extension to use for the image URL
* The extension to use for the image URL.
*
* @defaultValue `'webp'`
*/
extension?: ImageExtension;
/**
* The size specified in the image URL
* The size specified in the image URL.
*/
size?: ImageSize;
}
interface EmojiURLOptionsWebp extends BaseImageURLOptions {
/**
* Whether to use the `animated` query parameter.
*/
animated?: boolean;
extension?: 'webp';
}
interface EmojiURLOptionsNotWebp extends BaseImageURLOptions {
extension: Exclude<ImageExtension, 'webp'>;
}
/**
* The options used for image URLs with animated content
* The options used for emoji URLs.
*/
type EmojiURLOptions = EmojiURLOptionsNotWebp | EmojiURLOptionsWebp;
/**
* The options used for image URLs that may be animated.
*/
interface ImageURLOptions extends BaseImageURLOptions {
/**
* Whether or not to prefer the static version of an image asset.
* Whether to prefer the static asset.
*/
forceStatic?: boolean;
}
@@ -477,6 +491,10 @@ interface MakeURLOptions {
* The allowed extensions that can be used
*/
allowedExtensions?: readonly string[];
/**
* Whether to use the `animated` query parameter
*/
animated?: boolean;
/**
* The base URL.
*
@@ -579,7 +597,7 @@ declare class CDN {
* @param emojiId - The emoji id
* @param options - Optional options for the emoji
*/
emoji(emojiId: string, options?: Readonly<BaseImageURLOptions>): string;
emoji(emojiId: string, options?: Readonly<EmojiURLOptions>): string;
/**
* Generates an emoji's URL for an emoji.
*
@@ -669,6 +687,14 @@ declare class CDN {
* @param soundId - The soundboard sound id
*/
soundboardSound(soundId: string): string;
/**
* Generates a URL for a guild tag badge.
*
* @param guildId - The guild id
* @param badgeHash - The hash of the badge
* @param options - Optional options for the badge
*/
guildTagBadge(guildId: string, badgeHash: string, options?: Readonly<BaseImageURLOptions>): string;
/**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
*
@@ -929,4 +955,4 @@ declare function calculateUserDefaultAvatarIndex(userId: Snowflake): number;
*/
declare const version: string;
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version };
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type EmojiURLOptions, type EmojiURLOptionsNotWebp, type EmojiURLOptionsWebp, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version };

View File

@@ -127,7 +127,7 @@ var import_v102 = require("discord-api-types/v10");
// src/lib/utils/constants.ts
var import_util = require("@discordjs/util");
var import_v10 = require("discord-api-types/v10");
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.5.1)`;
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.6.0)`;
var DefaultUserAgentAppendix = (0, import_util.getUserAgentAppendix)();
var DefaultRestOptions = {
agent: null,
@@ -543,6 +543,16 @@ var CDN = class {
soundboardSound(soundId) {
return `${this.cdn}${import_v102.CDNRoutes.soundboardSound(soundId)}`;
}
/**
* Generates a URL for a guild tag badge.
*
* @param guildId - The guild id
* @param badgeHash - The hash of the badge
* @param options - Optional options for the badge
*/
guildTagBadge(guildId, badgeHash, options) {
return this.makeURL(`/guild-tag-badges/${guildId}/${badgeHash}`, options);
}
/**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
*
@@ -563,7 +573,8 @@ var CDN = class {
allowedExtensions = ALLOWED_EXTENSIONS,
base = this.cdn,
extension = "webp",
size
size,
animated
} = {}) {
extension = String(extension).toLowerCase();
if (!allowedExtensions.includes(extension)) {
@@ -575,6 +586,9 @@ Must be one of: ${allowedExtensions.join(", ")}`);
Must be one of: ${ALLOWED_SIZES.join(", ")}`);
}
const url = new URL(`${base}${route}.${extension}`);
if (animated !== void 0) {
url.searchParams.set("animated", String(animated));
}
if (size) {
url.searchParams.set("size", String(size));
}
@@ -1469,7 +1483,7 @@ var REST = class _REST extends import_async_event_emitter.AsyncEventEmitter {
};
// src/shared.ts
var version = "2.5.1";
var version = "2.6.0";
// src/index.ts
globalThis.FormData ??= import_undici2.FormData;

File diff suppressed because one or more lines are too long

View File

@@ -86,7 +86,7 @@ import { CDNRoutes } from "discord-api-types/v10";
// src/lib/utils/constants.ts
import { getUserAgentAppendix } from "@discordjs/util";
import { APIVersion } from "discord-api-types/v10";
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.5.1)`;
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.6.0)`;
var DefaultUserAgentAppendix = getUserAgentAppendix();
var DefaultRestOptions = {
agent: null,
@@ -502,6 +502,16 @@ var CDN = class {
soundboardSound(soundId) {
return `${this.cdn}${CDNRoutes.soundboardSound(soundId)}`;
}
/**
* Generates a URL for a guild tag badge.
*
* @param guildId - The guild id
* @param badgeHash - The hash of the badge
* @param options - Optional options for the badge
*/
guildTagBadge(guildId, badgeHash, options) {
return this.makeURL(`/guild-tag-badges/${guildId}/${badgeHash}`, options);
}
/**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
*
@@ -522,7 +532,8 @@ var CDN = class {
allowedExtensions = ALLOWED_EXTENSIONS,
base = this.cdn,
extension = "webp",
size
size,
animated
} = {}) {
extension = String(extension).toLowerCase();
if (!allowedExtensions.includes(extension)) {
@@ -534,6 +545,9 @@ Must be one of: ${allowedExtensions.join(", ")}`);
Must be one of: ${ALLOWED_SIZES.join(", ")}`);
}
const url = new URL(`${base}${route}.${extension}`);
if (animated !== void 0) {
url.searchParams.set("animated", String(animated));
}
if (size) {
url.searchParams.set("size", String(size));
}
@@ -1428,7 +1442,7 @@ var REST = class _REST extends AsyncEventEmitter {
};
// src/shared.ts
var version = "2.5.1";
var version = "2.6.0";
// src/index.ts
globalThis.FormData ??= FormData2;

File diff suppressed because one or more lines are too long

View File

@@ -446,26 +446,40 @@ declare const BurstHandlerMajorIdKey = "burst";
declare const DEPRECATION_WARNING_PREFIX: "DeprecationWarning";
/**
* The options used for image URLs
* The options used for image URLs.
*/
interface BaseImageURLOptions {
/**
* The extension to use for the image URL
* The extension to use for the image URL.
*
* @defaultValue `'webp'`
*/
extension?: ImageExtension;
/**
* The size specified in the image URL
* The size specified in the image URL.
*/
size?: ImageSize;
}
interface EmojiURLOptionsWebp extends BaseImageURLOptions {
/**
* Whether to use the `animated` query parameter.
*/
animated?: boolean;
extension?: 'webp';
}
interface EmojiURLOptionsNotWebp extends BaseImageURLOptions {
extension: Exclude<ImageExtension, 'webp'>;
}
/**
* The options used for image URLs with animated content
* The options used for emoji URLs.
*/
type EmojiURLOptions = EmojiURLOptionsNotWebp | EmojiURLOptionsWebp;
/**
* The options used for image URLs that may be animated.
*/
interface ImageURLOptions extends BaseImageURLOptions {
/**
* Whether or not to prefer the static version of an image asset.
* Whether to prefer the static asset.
*/
forceStatic?: boolean;
}
@@ -477,6 +491,10 @@ interface MakeURLOptions {
* The allowed extensions that can be used
*/
allowedExtensions?: readonly string[];
/**
* Whether to use the `animated` query parameter
*/
animated?: boolean;
/**
* The base URL.
*
@@ -579,7 +597,7 @@ declare class CDN {
* @param emojiId - The emoji id
* @param options - Optional options for the emoji
*/
emoji(emojiId: string, options?: Readonly<BaseImageURLOptions>): string;
emoji(emojiId: string, options?: Readonly<EmojiURLOptions>): string;
/**
* Generates an emoji's URL for an emoji.
*
@@ -669,6 +687,14 @@ declare class CDN {
* @param soundId - The soundboard sound id
*/
soundboardSound(soundId: string): string;
/**
* Generates a URL for a guild tag badge.
*
* @param guildId - The guild id
* @param badgeHash - The hash of the badge
* @param options - Optional options for the badge
*/
guildTagBadge(guildId: string, badgeHash: string, options?: Readonly<BaseImageURLOptions>): string;
/**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
*
@@ -929,4 +955,4 @@ declare function calculateUserDefaultAvatarIndex(userId: Snowflake): number;
*/
declare const version: string;
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version };
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type EmojiURLOptions, type EmojiURLOptionsNotWebp, type EmojiURLOptionsWebp, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version };

View File

@@ -446,26 +446,40 @@ declare const BurstHandlerMajorIdKey = "burst";
declare const DEPRECATION_WARNING_PREFIX: "DeprecationWarning";
/**
* The options used for image URLs
* The options used for image URLs.
*/
interface BaseImageURLOptions {
/**
* The extension to use for the image URL
* The extension to use for the image URL.
*
* @defaultValue `'webp'`
*/
extension?: ImageExtension;
/**
* The size specified in the image URL
* The size specified in the image URL.
*/
size?: ImageSize;
}
interface EmojiURLOptionsWebp extends BaseImageURLOptions {
/**
* Whether to use the `animated` query parameter.
*/
animated?: boolean;
extension?: 'webp';
}
interface EmojiURLOptionsNotWebp extends BaseImageURLOptions {
extension: Exclude<ImageExtension, 'webp'>;
}
/**
* The options used for image URLs with animated content
* The options used for emoji URLs.
*/
type EmojiURLOptions = EmojiURLOptionsNotWebp | EmojiURLOptionsWebp;
/**
* The options used for image URLs that may be animated.
*/
interface ImageURLOptions extends BaseImageURLOptions {
/**
* Whether or not to prefer the static version of an image asset.
* Whether to prefer the static asset.
*/
forceStatic?: boolean;
}
@@ -477,6 +491,10 @@ interface MakeURLOptions {
* The allowed extensions that can be used
*/
allowedExtensions?: readonly string[];
/**
* Whether to use the `animated` query parameter
*/
animated?: boolean;
/**
* The base URL.
*
@@ -579,7 +597,7 @@ declare class CDN {
* @param emojiId - The emoji id
* @param options - Optional options for the emoji
*/
emoji(emojiId: string, options?: Readonly<BaseImageURLOptions>): string;
emoji(emojiId: string, options?: Readonly<EmojiURLOptions>): string;
/**
* Generates an emoji's URL for an emoji.
*
@@ -669,6 +687,14 @@ declare class CDN {
* @param soundId - The soundboard sound id
*/
soundboardSound(soundId: string): string;
/**
* Generates a URL for a guild tag badge.
*
* @param guildId - The guild id
* @param badgeHash - The hash of the badge
* @param options - Optional options for the badge
*/
guildTagBadge(guildId: string, badgeHash: string, options?: Readonly<BaseImageURLOptions>): string;
/**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
*
@@ -929,4 +955,4 @@ declare function calculateUserDefaultAvatarIndex(userId: Snowflake): number;
*/
declare const version: string;
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version };
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type EmojiURLOptions, type EmojiURLOptionsNotWebp, type EmojiURLOptionsWebp, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version };

View File

@@ -61,7 +61,7 @@ var import_v102 = require("discord-api-types/v10");
// src/lib/utils/constants.ts
var import_util = require("@discordjs/util");
var import_v10 = require("discord-api-types/v10");
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.5.1)`;
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.6.0)`;
var DefaultUserAgentAppendix = (0, import_util.getUserAgentAppendix)();
var DefaultRestOptions = {
agent: null,
@@ -477,6 +477,16 @@ var CDN = class {
soundboardSound(soundId) {
return `${this.cdn}${import_v102.CDNRoutes.soundboardSound(soundId)}`;
}
/**
* Generates a URL for a guild tag badge.
*
* @param guildId - The guild id
* @param badgeHash - The hash of the badge
* @param options - Optional options for the badge
*/
guildTagBadge(guildId, badgeHash, options) {
return this.makeURL(`/guild-tag-badges/${guildId}/${badgeHash}`, options);
}
/**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
*
@@ -497,7 +507,8 @@ var CDN = class {
allowedExtensions = ALLOWED_EXTENSIONS,
base = this.cdn,
extension = "webp",
size
size,
animated
} = {}) {
extension = String(extension).toLowerCase();
if (!allowedExtensions.includes(extension)) {
@@ -509,6 +520,9 @@ Must be one of: ${allowedExtensions.join(", ")}`);
Must be one of: ${ALLOWED_SIZES.join(", ")}`);
}
const url = new URL(`${base}${route}.${extension}`);
if (animated !== void 0) {
url.searchParams.set("animated", String(animated));
}
if (size) {
url.searchParams.set("size", String(size));
}
@@ -1403,7 +1417,7 @@ var REST = class _REST extends import_async_event_emitter.AsyncEventEmitter {
};
// src/shared.ts
var version = "2.5.1";
var version = "2.6.0";
// src/web.ts
setDefaultStrategy(fetch);

File diff suppressed because one or more lines are too long

View File

@@ -18,7 +18,7 @@ import { CDNRoutes } from "discord-api-types/v10";
// src/lib/utils/constants.ts
import { getUserAgentAppendix } from "@discordjs/util";
import { APIVersion } from "discord-api-types/v10";
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.5.1)`;
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.6.0)`;
var DefaultUserAgentAppendix = getUserAgentAppendix();
var DefaultRestOptions = {
agent: null,
@@ -434,6 +434,16 @@ var CDN = class {
soundboardSound(soundId) {
return `${this.cdn}${CDNRoutes.soundboardSound(soundId)}`;
}
/**
* Generates a URL for a guild tag badge.
*
* @param guildId - The guild id
* @param badgeHash - The hash of the badge
* @param options - Optional options for the badge
*/
guildTagBadge(guildId, badgeHash, options) {
return this.makeURL(`/guild-tag-badges/${guildId}/${badgeHash}`, options);
}
/**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
*
@@ -454,7 +464,8 @@ var CDN = class {
allowedExtensions = ALLOWED_EXTENSIONS,
base = this.cdn,
extension = "webp",
size
size,
animated
} = {}) {
extension = String(extension).toLowerCase();
if (!allowedExtensions.includes(extension)) {
@@ -466,6 +477,9 @@ Must be one of: ${allowedExtensions.join(", ")}`);
Must be one of: ${ALLOWED_SIZES.join(", ")}`);
}
const url = new URL(`${base}${route}.${extension}`);
if (animated !== void 0) {
url.searchParams.set("animated", String(animated));
}
if (size) {
url.searchParams.set("size", String(size));
}
@@ -1360,7 +1374,7 @@ var REST = class _REST extends AsyncEventEmitter {
};
// src/shared.ts
var version = "2.5.1";
var version = "2.6.0";
// src/web.ts
setDefaultStrategy(fetch);

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@discordjs/rest",
"version": "2.5.1",
"version": "2.6.0",
"description": "The REST API for discord.js",
"exports": {
".": {
@@ -74,7 +74,7 @@
"@sapphire/async-queue": "^1.5.3",
"@sapphire/snowflake": "^3.5.3",
"@vladfrangu/async_event_emitter": "^2.4.6",
"discord-api-types": "^0.38.1",
"discord-api-types": "^0.38.16",
"magic-bytes.js": "^1.10.0",
"tslib": "^2.6.3",
"undici": "6.21.3",
@@ -95,8 +95,8 @@
"turbo": "^2.0.14",
"typescript": "~5.5.4",
"vitest": "^2.0.5",
"@discordjs/scripts": "^0.1.0",
"@discordjs/api-extractor": "^7.38.1"
"@discordjs/api-extractor": "^7.38.1",
"@discordjs/scripts": "^0.1.0"
},
"engines": {
"node": ">=18"