Parallaxox

Eval Command

Aug 12th, 2020 (edited)
674
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //https://www.youtube.com/watch?v=XUYxMV8HQ48
  2. if (message.author.id !== "276149334850928641") return;
  3.       const clean = text => {
  4.   if (typeof(text) === "string")
  5.     return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
  6.       return text;
  7. }
  8.         try {
  9.  
  10.       const code = args.slice().join(" ");
  11.       let evaled = eval(code);
  12.  
  13.       if (typeof evaled !== "string")
  14.         evaled = require("util").inspect(evaled);
  15.  
  16.       message.channel.send(clean(evaled), {code:"xl"});
  17.     } catch (err) {
  18.       message.channel.send(`\`ERROR\` \`\`\`xl\n${clean(err)}\n\`\`\``);
  19.     }
Add Comment
Please, Sign In to add comment