mirror of
https://github.com/danbulant/discord.js
synced 2026-06-09 09:42:22 +00:00
update image sizes, adding some more (#1781)
This commit is contained in:
parent
71f2cc10f1
commit
6065fe1f8c
1 changed files with 1 additions and 7 deletions
|
|
@ -95,13 +95,7 @@ const AllowedImageFormats = [
|
||||||
'gif',
|
'gif',
|
||||||
];
|
];
|
||||||
|
|
||||||
const AllowedImageSizes = [
|
const AllowedImageSizes = Array.from({ length: 8 }, (e, i) => 2 ** (i + 4));
|
||||||
128,
|
|
||||||
256,
|
|
||||||
512,
|
|
||||||
1024,
|
|
||||||
2048,
|
|
||||||
];
|
|
||||||
|
|
||||||
function makeImageUrl(root, { format = 'webp', size } = {}) {
|
function makeImageUrl(root, { format = 'webp', size } = {}) {
|
||||||
if (format && !AllowedImageFormats.includes(format)) throw new Error('IMAGE_FORMAT', format);
|
if (format && !AllowedImageFormats.includes(format)) throw new Error('IMAGE_FORMAT', format);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue