Removed unnecessary logs, fixed voice commands not working, made eval send a file if the output is too long

This commit is contained in:
TheEssem 2020-03-22 07:56:50 -05:00
parent 729192dfe7
commit 2823fb2fd3
3 changed files with 9 additions and 4 deletions

View File

@ -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,

View File

@ -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\`\`\``;
}

View File

@ -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