Removed unnecessary logs, fixed voice commands not working, made eval send a file if the output is too long
This commit is contained in:
parent
729192dfe7
commit
2823fb2fd3
3 changed files with 9 additions and 4 deletions
|
@ -7,7 +7,6 @@ exports.run = async (message) => {
|
||||||
const image = await require("../utils/imagedetect.js")(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!`;
|
if (image === undefined) return `${message.author.mention}, you need to provide an image to add a Bandicam watermark!`;
|
||||||
const watermark = "./assets/images/bandicam.png";
|
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);
|
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("", {
|
return message.channel.createMessage("", {
|
||||||
file: buffer,
|
file: buffer,
|
||||||
|
|
|
@ -6,7 +6,14 @@ exports.run = async (message, args) => {
|
||||||
try {
|
try {
|
||||||
const evaled = eval(code);
|
const evaled = eval(code);
|
||||||
const cleaned = await clean(evaled);
|
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) {
|
} catch (err) {
|
||||||
return `\`ERROR\` \`\`\`xl\n${await clean(err)}\n\`\`\``;
|
return `\`ERROR\` \`\`\`xl\n${await clean(err)}\n\`\`\``;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,7 @@ const client = new Client(process.env.TOKEN, {
|
||||||
GUILD_ROLE_DELETE: true,
|
GUILD_ROLE_DELETE: true,
|
||||||
GUILD_ROLE_UPDATE: true,
|
GUILD_ROLE_UPDATE: true,
|
||||||
TYPING_START: true,
|
TYPING_START: true,
|
||||||
USER_UPDATE: true,
|
USER_UPDATE: true
|
||||||
VOICE_STATE_UPDATE: true
|
|
||||||
},
|
},
|
||||||
maxShards: "auto",
|
maxShards: "auto",
|
||||||
opusOnly: true
|
opusOnly: true
|
||||||
|
|
Loading…
Reference in a new issue