rip rip rip

This commit is contained in:
Elizabeth
2017-07-12 19:45:31 -05:00
parent afe98a18a4
commit 8d442a67e8
181 changed files with 0 additions and 21 deletions
+30
View File
@@ -0,0 +1,30 @@
const Command = require('../../structures/Command');
const math = require('mathjs');
module.exports = class MathCommand extends Command {
constructor(client) {
super(client, {
name: 'math',
group: 'num-edit',
memberName: 'math',
description: 'Evaluates math expressions.',
args: [
{
key: 'expression',
prompt: 'What do you want to answer?',
type: 'string'
}
]
});
}
run(msg, args) {
const { expression } = args;
try {
const solved = math.eval(expression).toString();
return msg.say(solved).catch(() => msg.say('Invalid Statement'));
} catch (err) {
return msg.say('Invalid Statement');
}
}
};