mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(AllowedImageSizes): add new image sizes (#6754)
This commit is contained in:
@@ -16,7 +16,7 @@ exports.WSCodes = {
|
||||
|
||||
const AllowedImageFormats = ['webp', 'png', 'jpg', 'jpeg', 'gif'];
|
||||
|
||||
const AllowedImageSizes = Array.from({ length: 9 }, (e, i) => 2 ** (i + 4));
|
||||
const AllowedImageSizes = [16, 32, 64, 128, 256, 300, 512, 600, 1024, 2048, 4096];
|
||||
|
||||
function makeImageUrl(root, { format = 'webp', size } = {}) {
|
||||
if (!['undefined', 'number'].includes(typeof size)) throw new TypeError('INVALID_TYPE', 'size', 'number');
|
||||
@@ -35,7 +35,7 @@ function makeImageUrl(root, { format = 'webp', size } = {}) {
|
||||
* Options for static Image URLs.
|
||||
* @typedef {Object} StaticImageURLOptions
|
||||
* @property {string} [format='webp'] One of `webp`, `png`, `jpg`, `jpeg`.
|
||||
* @property {number} [size] One of `16`, `32`, `64`, `128`, `256`, `512`, `1024`, `2048`, `4096`
|
||||
* @property {number} [size] One of `16`, `32`, `64`, `128`, `256`, `300`, `512`, `600`, `1024`, `2048`, `4096`
|
||||
*/
|
||||
|
||||
// https://discord.com/developers/docs/reference#image-formatting-cdn-endpoints
|
||||
|
||||
2
typings/index.d.ts
vendored
2
typings/index.d.ts
vendored
@@ -2980,7 +2980,7 @@ export interface AddGuildMemberOptions {
|
||||
|
||||
export type AllowedImageFormat = 'webp' | 'png' | 'jpg' | 'jpeg';
|
||||
|
||||
export type AllowedImageSize = 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096;
|
||||
export type AllowedImageSize = 16 | 32 | 64 | 128 | 256 | 300 | 512 | 600 | 1024 | 2048 | 4096;
|
||||
|
||||
export type AllowedPartial = User | Channel | GuildMember | Message | MessageReaction;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user