Better Math Game, Remove Math Command

This commit is contained in:
Daniel Odendahl Jr
2017-08-30 16:49:59 +00:00
parent f46864dce3
commit b997537505
3 changed files with 30 additions and 50 deletions
-30
View File
@@ -1,30 +0,0 @@
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.');
}
}
};