Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const {
  2.     Token,
  3.     Prefix,
  4.     Roles,
  5.     Colours
  6.   } = require("../data/settings.json");
  7.   const fs = require("fs");
  8.   const Discord = require("discord.js");
  9.  
  10.   module.exports.run = async(Client, message, arguments) => {
  11.  
  12.     const errorEmbed = new Discord.RichEmbed()
  13.     .setAuthor(message.author.tag, message.author.avatarURL)
  14.     .setColor(Colours.Red)
  15.     .setDescription("You are not authorised to run this command.")
  16.     .setFooter("If you think that this was an error or a mistake, contact an Executive of Café Connections.");
  17.  
  18.     var developerStatus;
  19.  
  20.     if(!fs.exists(`../data/developers/${message.author.id}.json`)) return message.channel.send(errorEmbed);
  21.     fs.readFile(`../data/developers/${message.author.id}.json`, 'utf8', function(data) {
  22.         developerStatus = JSON.parse(data);
  23.         if(developerStatus.Developer_status === false) return message.channel.send(errorEmbed);
  24.     });
  25.  
  26.     const clean = text => {
  27.         if (typeof(text) === "string")
  28.             return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
  29.         else
  30.             return text;
  31.     }
  32.    
  33.     try {
  34.         const code = arguments.join(" ");
  35.         let evaled = await eval(code);
  36.         if (typeof evaled !== "string")
  37.             evaled = require("util").inspect(evaled);
  38.         message.reply(clean(evaled), {
  39.             code: "xl"
  40.         });
  41.     } catch (err) {
  42.         message.reply(`\`ERROR\` \`\`\`xl\n${clean(err)}\n\`\`\``);
  43.    
  44.     }
  45.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement