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);
 | 
			
		||||
  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,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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\`\`\``;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue