Skip to content

Commit

Permalink
fix(AllowedImageSizes): add new image sizes (#6844)
Browse files Browse the repository at this point in the history
  • Loading branch information
ObscuritySRL committed Oct 16, 2021
1 parent f7b7aac commit ef01b84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/util/Constants.js
Expand Up @@ -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');
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion typings/index.d.ts
Expand Up @@ -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;

Expand Down

0 comments on commit ef01b84

Please sign in to comment.