From 2823fb2fd3621097ac582f87a6f014c5087b072a Mon Sep 17 00:00:00 2001 From: TheEssem Date: Sun, 22 Mar 2020 07:56:50 -0500 Subject: [PATCH] Removed unnecessary logs, fixed voice commands not working, made eval send a file if the output is too long --- commands/bandicam.js | 1 - commands/eval.js | 9 ++++++++- utils/client.js | 3 +-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/commands/bandicam.js b/commands/bandicam.js index 15b11b7..184306e 100644 --- a/commands/bandicam.js +++ b/commands/bandicam.js @@ -7,7 +7,6 @@ exports.run = async (message) => { const image = await require("../utils/imagedetect.js")(message); if (image === undefined) return `${message.author.mention}, you need to provide an image to add a Bandicam watermark!`; const watermark = "./assets/images/bandicam.png"; - console.log(image.delay); const buffer = await gm(image.path).coalesce().out("null:").out(watermark).gravity("North").resize(null, "%[fx:u.h]").out("-layers", "composite").bufferPromise(image.type, image.delay); return message.channel.createMessage("", { file: buffer, diff --git a/commands/eval.js b/commands/eval.js index 7778373..c556b30 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -6,7 +6,14 @@ exports.run = async (message, args) => { try { const evaled = eval(code); const cleaned = await clean(evaled); - return `\`\`\`js\n${cleaned}\n\`\`\``; + const sendString = `\`\`\`js\n${cleaned}\n\`\`\``; + if (sendString.length >= 2000) { + return message.channel.createMessage("The result was too large, so here it is as a file:", [{ + file: evaled, + name: "result.txt" + }]); + } + return sendString; } catch (err) { return `\`ERROR\` \`\`\`xl\n${await clean(err)}\n\`\`\``; } diff --git a/utils/client.js b/utils/client.js index df883b1..08a4280 100644 --- a/utils/client.js +++ b/utils/client.js @@ -14,8 +14,7 @@ const client = new Client(process.env.TOKEN, { GUILD_ROLE_DELETE: true, GUILD_ROLE_UPDATE: true, TYPING_START: true, - USER_UPDATE: true, - VOICE_STATE_UPDATE: true + USER_UPDATE: true }, maxShards: "auto", opusOnly: true