Fix minor bug

- TypeError: this.client.rest.cdn.avatar is not a function
- ReferenceError: AllowedImageFormats is not defined
This commit is contained in:
March 7th
2022-03-23 18:36:58 +07:00
parent e8b87a1778
commit 6f6c986fd2
4 changed files with 373 additions and 355 deletions

View File

@@ -200,6 +200,12 @@ exports.Events = {
GUILD_SCHEDULED_EVENT_USER_REMOVE: 'guildScheduledEventUserRemove',
};
const AllowedImageFormats = ['webp', 'png', 'jpg', 'jpeg', 'gif'];
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');
if (format && !AllowedImageFormats.includes(format)) throw new Error('IMAGE_FORMAT', format);

View File

@@ -101,7 +101,7 @@ class Options extends null {
$browser: 'Chrome',
$device: 'ASUS ROG Phone 5',
},
version: 9,
version: 10,
},
http: {
headers: {