fix(AllowedImageSizes): add new image sizes (#6844)

This commit is contained in:
ObscuritySRL
2021-10-16 18:18:17 -04:00
committed by GitHub
parent f7b7aac8b6
commit ef01b84fa8
2 changed files with 4 additions and 3 deletions

View File

@@ -16,7 +16,7 @@ exports.WSCodes = {
const AllowedImageFormats = ['webp', 'png', 'jpg', 'jpeg', 'gif'];
const AllowedImageSizes = [16, 32, 64, 128, 256, 300, 512, 600, 1024, 2048, 4096];
const AllowedImageSizes = [16, 32, 56, 64, 96, 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,8 @@ 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`, `300`, `512`, `600`, `1024`, `2048`, `4096`
* @property {number} [size] One of `16`, `32`, `56`, `64`, `96`, `128`, `256`, `300`, `512`, `600`, `1024`, `2048`,
* `4096`
*/
// https://discord.com/developers/docs/reference#image-formatting-cdn-endpoints

2
typings/index.d.ts vendored
View File

@@ -2989,7 +2989,7 @@ export interface AddGuildMemberOptions {
export type AllowedImageFormat = 'webp' | 'png' | 'jpg' | 'jpeg';
export type AllowedImageSize = 16 | 32 | 64 | 128 | 256 | 300 | 512 | 600 | 1024 | 2048 | 4096;
export type AllowedImageSize = 16 | 32 | 56 | 64 | 96 | 128 | 256 | 300 | 512 | 600 | 1024 | 2048 | 4096;
export type AllowedPartial = User | Channel | GuildMember | Message | MessageReaction;