aboutsummaryrefslogtreecommitdiff
path: root/commands/eval.js
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2020-07-23 11:41:02 -0400
committerAndrew Lee <alee14498@protonmail.com>2020-07-23 11:41:02 -0400
commited456ef581c5acd852a924d9cc274a259b2d8ce5 (patch)
tree33be62f54239fa6f6b61b9488dbfde329ae1fd78 /commands/eval.js
parent1ce861095b2793a1b49546c0adf460fbc2fc5d9f (diff)
downloadAleeBot-ed456ef581c5acd852a924d9cc274a259b2d8ce5.tar.gz
AleeBot-ed456ef581c5acd852a924d9cc274a259b2d8ce5.tar.bz2
AleeBot-ed456ef581c5acd852a924d9cc274a259b2d8ce5.zip
Converted to Discord.JS v12, starting database
Diffstat (limited to 'commands/eval.js')
-rw-r--r--commands/eval.js104
1 files changed, 52 insertions, 52 deletions
diff --git a/commands/eval.js b/commands/eval.js
index 2147376..ef8fc97 100644
--- a/commands/eval.js
+++ b/commands/eval.js
@@ -18,67 +18,67 @@
*
* *************************************/
module.exports.run = async (client, message, args) => {
- if (!['242775871059001344'].includes(message.author.id)) return message.reply('Nope! You need the person who created this bot to use this command.');
- const {RichEmbed} = require('discord.js');
- const code = args.join(' ');
+ if (!['242775871059001344'].includes(message.author.id)) return message.reply('Nope! You need the person who created this bot to use this command.');
+ const {MessageEmbed} = require('discord.js');
+ const code = args.join(' ');
- let evaled;
- let remove;
+ let evaled;
+ let remove;
- try {
- remove = (text) => {
- if (typeof(text) === 'string') {
- return text.replace(/`/g, '`' + String.fromCharCode(8203)).replace(/@/g, '@' + String.fromCharCode(8203));
- } else {
- return text;
- }
- };
+ try {
+ remove = (text) => {
+ if (typeof(text) === 'string') {
+ return text.replace(/`/g, '`' + String.fromCharCode(8203)).replace(/@/g, '@' + String.fromCharCode(8203));
+ } else {
+ return text;
+ }
+ };
- evaled = eval(code);
+ evaled = eval(code);
- if (typeof evaled !== 'string') {
- evaled = require('util').inspect(evaled);
- }
- } catch (err) {
- const embed = new RichEmbed()
- .setAuthor('Eval Error')
- .setDescription('Eval\'s result')
- .addField(':inbox_tray: Input:', `\`\`\`js\n${code}\n\`\`\``)
- .addField(':outbox_tray: Output:', `\`\`\`${err}\`\`\``)
- .setFooter('Eval', client.user.avatarURL)
- .setColor('RED');
- return message.channel.send({embed});
- }
+ if (typeof evaled !== 'string') {
+ evaled = require('util').inspect(evaled);
+ }
+ } catch (err) {
+ const embed = new MessageEmbed()
+ .setAuthor('Eval Error')
+ .setDescription('Eval\'s result')
+ .addField(':inbox_tray: Input:', `\`\`\`js\n${code}\n\`\`\``)
+ .addField(':outbox_tray: Output:', `\`\`\`${err}\`\`\``)
+ .setFooter('Eval', client.user.avatarURL())
+ .setColor('RED');
+ return message.channel.send({embed});
+ }
- try {
- const embed = new RichEmbed()
- .setAuthor('Eval Success')
- .setDescription('Eval\'s result')
- .addField(':inbox_tray: Input:', `\`\`\`js\n${code}\n\`\`\``)
- .addField(':outbox_tray: Output:', `\`\`\`js\n${remove(evaled)}\n\`\`\``)
- .setFooter('Eval', client.user.avatarURL)
- .setColor('GREEN');
+ try {
+ const embed = new MessageEmbed()
+ .setAuthor('Eval Success')
+ .setDescription('Eval\'s result')
+ .addField(':inbox_tray: Input:', `\`\`\`js\n${code}\n\`\`\``)
+ .addField(':outbox_tray: Output:', `\`\`\`js\n${remove(evaled)}\n\`\`\``)
+ .setFooter('Eval', client.user.avatarURL())
+ .setColor('GREEN');
- return message.channel.send({embed});
- } catch (err) {
- const embed = new RichEmbed()
- .setAuthor('Eval Error')
- .setDescription('Eval\'s result')
- .addField(':inbox_tray: Input:', `\`\`\`js\n${code}\n\`\`\``)
- .addField(':outbox_tray: Output:', `\`\`\`${err}\`\`\``)
- .setFooter('Eval', client.user.avatarURL)
- .setColor('RED');
- return message.channel.send({embed});
- }
+ return message.channel.send({embed});
+ } catch (err) {
+ const embed = new MessageEmbed()
+ .setAuthor('Eval Error')
+ .setDescription('Eval\'s result')
+ .addField(':inbox_tray: Input:', `\`\`\`js\n${code}\n\`\`\``)
+ .addField(':outbox_tray: Output:', `\`\`\`${err}\`\`\``)
+ .setFooter('Eval', client.user.avatarURL())
+ .setColor('RED');
+ return message.channel.send({embed});
+ }
};
exports.conf = {
- aliases: [],
- guildOnly: false,
+ aliases: [],
+ guildOnly: false,
};
exports.help = {
- name: 'eval',
- description: 'Evalulates commands.',
- usage: '<code>',
- category: '- Owners Only',
+ name: 'eval',
+ description: 'Evalulates commands.',
+ usage: '<code>',
+ category: '- Owners Only',
};