Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Commit

Permalink
Make Eval an embed
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Ray committed Sep 26, 2018
1 parent 1cebe40 commit 1b34332
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
6 changes: 3 additions & 3 deletions commands/eping.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ exports.conf = {
};

exports.help = {
name: "ping",
name: "eping",
category: "Misc",
description: "Pings the bot, responds with API and regular latencies.",
usage: "ping"
description: "Pings the bot, but replies with an embed.",
usage: "eping"
};
17 changes: 15 additions & 2 deletions commands/eval.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
const os = require('os')
const Discord = require('discord.js')
exports.run = async (client, message, args, level) => {
const code = args.join(" ");
try {
const evaled = eval(code);
const clean = await client.clean(client, evaled);
message.channel.send(`\`\`\`js\n${clean}\n\`\`\``);
const embed1 = new Discord.RichEmbed()
.setAuthor(client.user.username, client.user.avatarURL)
.setTitle('__JAVASCRIPT EVALUATION__')
.setDescription(`\`\`\`js\n${clean}\n\`\`\``)
.setTimestamp()
.setFooter(`${client.user.username} | Requested by ${message.author.username}#${message.author.discriminator}`);
message.channel.send(embed1)
} catch (err) {
message.channel.send(`\`ERROR\` \`\`\`xl\n${await client.clean(client, err)}\n\`\`\``);
const embed2 = new Discord.RichEmbed()
embed2.setAuthor(client.user.username, client.user.avatarURL)
embed2.setTitle('__JAVASCRIPT EVALUATION__')
embed2.setDescription(`\`ERROR\` \`\`\`xl\n${await client.clean(client, err)}\n\`\`\``);
embed2.setTimestamp()
embed2.setFooter(`${client.user.username} | Requested by ${message.author.username}#${message.author.discriminator}`);
message.channel.send(embed2)
}
};

Expand Down

0 comments on commit 1b34332

Please sign in to comment.