2019-08-14 12:26:33 +00:00
|
|
|
module.exports = {
|
|
|
|
name: 'eval',
|
|
|
|
description: 'Evaluation command',
|
2019-10-31 18:29:26 +00:00
|
|
|
alias: 'eval',
|
2019-08-14 12:26:33 +00:00
|
|
|
cooldown: 5,
|
2019-11-01 11:39:04 +00:00
|
|
|
onlyDev: true,
|
2019-10-10 13:43:04 +00:00
|
|
|
async execute(message, args, client, Discord, prefix) {
|
2019-10-12 10:43:09 +00:00
|
|
|
const ytdl = require('ytdl-core');
|
2019-08-14 12:26:33 +00:00
|
|
|
const serverQueue = client.queue.get(message.guild.id);
|
2019-10-12 14:40:00 +00:00
|
|
|
if (serverQueue) {
|
|
|
|
let data = await Promise.resolve(ytdl.getInfo(serverQueue.songs[0].url));
|
|
|
|
}
|
2019-10-10 13:43:04 +00:00
|
|
|
const input = message.content.slice(prefix.length + 4);
|
2019-08-14 12:26:33 +00:00
|
|
|
let output;
|
|
|
|
try {
|
|
|
|
output = await eval(input);
|
|
|
|
} catch (error) {
|
|
|
|
output = error.toString();
|
|
|
|
}
|
2019-10-10 13:43:04 +00:00
|
|
|
const embed = new Discord.RichEmbed()
|
2019-08-14 12:26:33 +00:00
|
|
|
.setTitle('Evaluation Command')
|
2019-12-05 13:17:15 +00:00
|
|
|
.setColor(client.config.embedColor)
|
2019-08-14 12:26:33 +00:00
|
|
|
.setDescription(`Input: \`\`\`js\n${input.replace(/; /g, ';').replace(/;/g, ';\n')}\n\`\`\`\nOutput: \`\`\`\n${output}\n\`\`\``);
|
|
|
|
return message.channel.send(embed);
|
|
|
|
},
|
2019-10-31 21:49:48 +00:00
|
|
|
};
|