Update packages
This commit is contained in:
parent
636857e20f
commit
e179b923f0
7 changed files with 521 additions and 564 deletions
|
@ -7,7 +7,7 @@ class MCCommand extends Command {
|
||||||
this.client.sendChannelTyping(this.message.channel.id);
|
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("+"))}`);
|
const request = await fetch(`https://www.minecraftskinstealer.com/achievement/a.php?i=13&h=Achievement+get%21&t=${encodeURIComponent(this.args.join("+"))}`);
|
||||||
return {
|
return {
|
||||||
file: await request.buffer(),
|
file: Buffer.from(await request.arrayBuffer()),
|
||||||
name: "mc.png"
|
name: "mc.png"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ class WikihowCommand extends Command {
|
||||||
});
|
});
|
||||||
const json = await request.json();
|
const json = await request.json();
|
||||||
const image = await fetch(json["1"]);
|
const image = await fetch(json["1"]);
|
||||||
const imageBuffer = await image.buffer();
|
const imageBuffer = Buffer.from(await image.arrayBuffer());
|
||||||
return {
|
return {
|
||||||
file: imageBuffer,
|
file: imageBuffer,
|
||||||
name: json["1"].split("/")[json["1"].split("/").length - 1]
|
name: json["1"].split("/")[json["1"].split("/").length - 1]
|
||||||
|
|
1061
package-lock.json
generated
1061
package-lock.json
generated
File diff suppressed because it is too large
Load diff
14
package.json
14
package.json
|
@ -25,24 +25,24 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@top-gg/sdk": "^3.1.1",
|
"@top-gg/sdk": "^3.1.1",
|
||||||
"cowsay2": "^2.0.4",
|
"cowsay2": "^2.0.4",
|
||||||
"dotenv": "^9.0.2",
|
"dotenv": "^10.0.0",
|
||||||
"emoji-regex": "^9.2.2",
|
"emoji-regex": "^10.0.0",
|
||||||
"eris": "github:abalabahaha/eris#dev",
|
"eris": "github:abalabahaha/eris#dev",
|
||||||
"eris-fleet": "github:esmBot/eris-fleet#development",
|
"eris-fleet": "github:esmBot/eris-fleet#development",
|
||||||
"file-type": "^16.1.0",
|
"file-type": "^16.1.0",
|
||||||
"format-duration": "^1.4.0",
|
"format-duration": "^1.4.0",
|
||||||
"lavacord": "^1.1.9",
|
"lavacord": "^1.1.9",
|
||||||
"node-addon-api": "^3.2.1",
|
"node-addon-api": "^4.2.0",
|
||||||
"node-emoji": "^1.10.0",
|
"node-emoji": "^1.10.0",
|
||||||
"node-fetch": "^2.6.1",
|
"node-fetch": "^3.1.0",
|
||||||
"winston": "^3.3.3"
|
"winston": "^3.3.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/eslint-parser": "^7.13.8",
|
"@babel/eslint-parser": "^7.13.8",
|
||||||
"@babel/eslint-plugin": "^7.13.0",
|
"@babel/eslint-plugin": "^7.13.0",
|
||||||
"@babel/plugin-proposal-class-properties": "^7.13.0",
|
"@babel/plugin-proposal-class-properties": "^7.13.0",
|
||||||
"eslint": "^7.32.0",
|
"eslint": "^8.2.0",
|
||||||
"eslint-plugin-unicorn": "^35.0.0"
|
"eslint-plugin-unicorn": "^38.0.1"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"better-sqlite3": "^7.4.1",
|
"better-sqlite3": "^7.4.1",
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
"erlpack": "github:abalabahaha/erlpack",
|
"erlpack": "github:abalabahaha/erlpack",
|
||||||
"pg": "^8.5.1",
|
"pg": "^8.5.1",
|
||||||
"uuid": "^8.3.1",
|
"uuid": "^8.3.1",
|
||||||
"ws": "^7.5.0",
|
"ws": "^8.2.3",
|
||||||
"zlib-sync": "^0.1.6"
|
"zlib-sync": "^0.1.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ function run(object) {
|
||||||
buffer: Buffer.alloc(0),
|
buffer: Buffer.alloc(0),
|
||||||
fileExtension: "nogif"
|
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").
|
// 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.
|
// Don't set `type` directly on the object we are passed as it will be read afterwards.
|
||||||
|
|
|
@ -35,7 +35,7 @@ export async function getType(image, extraReturnTypes) {
|
||||||
type = "large";
|
type = "large";
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
const imageBuffer = await imageRequest.buffer();
|
const imageBuffer = await imageRequest.arrayBuffer();
|
||||||
const imageType = await fileType.fromBuffer(imageBuffer);
|
const imageType = await fileType.fromBuffer(imageBuffer);
|
||||||
if (imageType && formats.includes(imageType.mime)) {
|
if (imageType && formats.includes(imageType.mime)) {
|
||||||
type = imageType.mime;
|
type = imageType.mime;
|
||||||
|
|
|
@ -177,7 +177,7 @@ class ImageWorker extends BaseServiceWorker {
|
||||||
"Authentication": auth && auth !== "" ? auth : undefined
|
"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
|
// 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.
|
// by a newline, followed by the image data.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue