diff --git a/commands/screenshot.js b/commands/screenshot.js index 2c53f19..2766f25 100644 --- a/commands/screenshot.js +++ b/commands/screenshot.js @@ -5,7 +5,7 @@ const fetch = require("node-fetch"); exports.run = async (message, args) => { message.channel.sendTyping(); if (args.length === 0) return `${message.author.mention}, you need to provide a URL to screenshot!`; - const getEndpoint = await fetch("http://172.17.0.2:9222/json/version"); + const getEndpoint = await fetch(`http://${process.env.NODE_ENV === "development" ? "192.168.99.100" : "172.17.0.2"}:9222/json/version`); const endpoint = await getEndpoint.json(); const url = urlRegex.test(args[0]) ? args[0] : `http://${args[0]}`; const browser = await puppeteer.connect({ diff --git a/events/ready.js b/events/ready.js index 2119735..3c92bfe 100644 --- a/events/ready.js +++ b/events/ready.js @@ -50,18 +50,15 @@ module.exports = async () => { gm.prototype.bufferPromise = function(format, type) { return new Promise((resolve, reject) => { if (format) { - console.log(format); this.out(type !== "sonic" ? "-layers" : "", type !== "sonic" ? "optimize" : "").stream(format, (err, stdout, stderr) => { if (err) return reject(err); const chunks = []; stdout.on("data", (chunk) => { - console.log(chunk); chunks.push(chunk); }); // these are 'once' because they can and do fire multiple times for multiple errors, // but this is a promise so you'll have to deal with them one at a time stdout.once("end", () => { - console.log(Buffer.concat(chunks)); resolve(Buffer.concat(chunks)); }); stderr.once("data", (data) => { diff --git a/package-lock.json b/package-lock.json index 7fd5f9b..19eb381 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "esmbot", - "version": "1.1.7", + "version": "1.2.1", "lockfileVersion": 1, "requires": true, "dependencies": {