Update packages

This commit is contained in:
Essem 2021-11-20 00:55:25 -06:00
parent 636857e20f
commit e179b923f0
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
7 changed files with 521 additions and 564 deletions

View file

@ -7,7 +7,7 @@ class MCCommand extends Command {
this.client.sendChannelTyping(this.message.channel.id);
const request = await fetch(`https://www.minecraftskinstealer.com/achievement/a.php?i=13&h=Achievement+get%21&t=${encodeURIComponent(this.args.join("+"))}`);
return {
file: await request.buffer(),
file: Buffer.from(await request.arrayBuffer()),
name: "mc.png"
};
}

View file

@ -13,7 +13,7 @@ class WikihowCommand extends Command {
});
const json = await request.json();
const image = await fetch(json["1"]);
const imageBuffer = await image.buffer();
const imageBuffer = Buffer.from(await image.arrayBuffer());
return {
file: imageBuffer,
name: json["1"].split("/")[json["1"].split("/").length - 1]

1059
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -25,24 +25,24 @@
"dependencies": {
"@top-gg/sdk": "^3.1.1",
"cowsay2": "^2.0.4",
"dotenv": "^9.0.2",
"emoji-regex": "^9.2.2",
"dotenv": "^10.0.0",
"emoji-regex": "^10.0.0",
"eris": "github:abalabahaha/eris#dev",
"eris-fleet": "github:esmBot/eris-fleet#development",
"file-type": "^16.1.0",
"format-duration": "^1.4.0",
"lavacord": "^1.1.9",
"node-addon-api": "^3.2.1",
"node-addon-api": "^4.2.0",
"node-emoji": "^1.10.0",
"node-fetch": "^2.6.1",
"node-fetch": "^3.1.0",
"winston": "^3.3.3"
},
"devDependencies": {
"@babel/eslint-parser": "^7.13.8",
"@babel/eslint-plugin": "^7.13.0",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"eslint": "^7.32.0",
"eslint-plugin-unicorn": "^35.0.0"
"eslint": "^8.2.0",
"eslint-plugin-unicorn": "^38.0.1"
},
"optionalDependencies": {
"better-sqlite3": "^7.4.1",
@ -50,7 +50,7 @@
"erlpack": "github:abalabahaha/erlpack",
"pg": "^8.5.1",
"uuid": "^8.3.1",
"ws": "^7.5.0",
"ws": "^8.2.3",
"zlib-sync": "^0.1.6"
}
}

View file

@ -15,7 +15,7 @@ function run(object) {
buffer: Buffer.alloc(0),
fileExtension: "nogif"
});
promise = fetch(object.path).then(res => res.buffer());
promise = fetch(object.path).then(res => res.arrayBuffer()).then(buf => { return Buffer.from(buf); });
}
// Convert from a MIME type (e.g. "image/png") to something ImageMagick understands (e.g. "png").
// Don't set `type` directly on the object we are passed as it will be read afterwards.

View file

@ -35,7 +35,7 @@ export async function getType(image, extraReturnTypes) {
type = "large";
return type;
}
const imageBuffer = await imageRequest.buffer();
const imageBuffer = await imageRequest.arrayBuffer();
const imageType = await fileType.fromBuffer(imageBuffer);
if (imageType && formats.includes(imageType.mime)) {
type = imageType.mime;

View file

@ -177,7 +177,7 @@ class ImageWorker extends BaseServiceWorker {
"Authentication": auth && auth !== "" ? auth : undefined
}
});
const image = await imageReq.buffer();
const image = Buffer.from(await imageReq.arrayBuffer());
// The response data is given as the file extension/ImageMagick type of the image (e.g. "png"), followed
// by a newline, followed by the image data.