Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const {
- Token,
- Prefix,
- Roles,
- Colours
- } = require("../data/settings.json");
- const fs = require("fs");
- const Discord = require("discord.js");
- module.exports.run = async(Client, message, arguments) => {
- const errorEmbed = new Discord.RichEmbed()
- .setAuthor(message.author.tag, message.author.avatarURL)
- .setColor(Colours.Red)
- .setDescription("You are not authorised to run this command.")
- .setFooter("If you think that this was an error or a mistake, contact an Executive of Café Connections.");
- var developerStatus;
- if(!fs.exists(`../data/developers/${message.author.id}.json`)) return message.channel.send(errorEmbed);
- fs.readFile(`../data/developers/${message.author.id}.json`, 'utf8', function(data) {
- developerStatus = JSON.parse(data);
- if(developerStatus.Developer_status === false) return message.channel.send(errorEmbed);
- });
- const clean = text => {
- if (typeof(text) === "string")
- return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
- else
- return text;
- }
- try {
- const code = arguments.join(" ");
- let evaled = await eval(code);
- if (typeof evaled !== "string")
- evaled = require("util").inspect(evaled);
- message.reply(clean(evaled), {
- code: "xl"
- });
- } catch (err) {
- message.reply(`\`ERROR\` \`\`\`xl\n${clean(err)}\n\`\`\``);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement