diff --git a/src/util/Constants.js b/src/util/Constants.js index baad53084..b3c23914d 100644 --- a/src/util/Constants.js +++ b/src/util/Constants.js @@ -98,9 +98,9 @@ exports.WSCodes = { 4014: 'DISALLOWED_INTENTS', }; -const AllowedImageFormats = ['webp', 'png', 'jpg', 'gif']; +const AllowedImageFormats = ['webp', 'png', 'jpg', 'jpeg', 'gif']; -const AllowedImageSizes = Array.from({ length: 8 }, (e, i) => 2 ** (i + 4)); +const AllowedImageSizes = Array.from({ length: 9 }, (e, i) => 2 ** (i + 4)); function makeImageUrl(root, { format = 'webp', size } = {}) { if (format && !AllowedImageFormats.includes(format)) throw new Error('IMAGE_FORMAT', format); @@ -110,11 +110,11 @@ function makeImageUrl(root, { format = 'webp', size } = {}) { /** * Options for Image URLs. * @typedef {Object} ImageURLOptions - * @property {string} [format] One of `webp`, `png`, `jpg`, `gif`. If no format is provided, + * @property {string} [format] One of `webp`, `png`, `jpg`, `jpeg`, `gif`. If no format is provided, * defaults to `webp`. * @property {boolean} [dynamic] If true, the format will dynamically change to `gif` for * animated avatars; the default is false. - * @property {number} [size] One of `16`, `32`, `64`, `128`, `256`, `512`, `1024`, `2048` + * @property {number} [size] One of `16`, `32`, `64`, `128`, `256`, `512`, `1024`, `2048`, `4096` */ exports.Endpoints = { diff --git a/typings/index.d.ts b/typings/index.d.ts index 85aba0c62..e8ad3c621 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -269,7 +269,7 @@ declare module 'discord.js' { public once(event: 'end', listener: (collected: Collection, reason: string) => void): this; } - type AllowedImageFormat = 'webp' | 'png' | 'jpg' | 'gif'; + type AllowedImageFormat = 'webp' | 'png' | 'jpg' | 'jpeg' | 'gif'; export const Constants: { Package: { @@ -2542,12 +2542,10 @@ declare module 'discord.js' { invite?: string; } - type ImageExt = 'webp' | 'png' | 'jpg' | 'gif'; - - type ImageSize = 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048; + type ImageSize = 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096; interface ImageURLOptions { - format?: ImageExt; + format?: AllowedImageFormat; size?: ImageSize; }