Move Groups Around

This commit is contained in:
Daniel Odendahl Jr
2017-05-06 03:57:56 +00:00
parent 77b3a8ead8
commit c27ed061fb
8 changed files with 7 additions and 8 deletions
+31
View File
@@ -0,0 +1,31 @@
const { Command } = require('discord.js-commando');
const math = require('mathjs');
module.exports = class MathCommand extends Command {
constructor(client) {
super(client, {
name: 'math',
group: 'numedit',
memberName: 'math',
description: 'Does math.',
args: [
{
key: 'expression',
prompt: 'What do you want to answer?',
type: 'string'
}
]
});
}
run(msg, args) {
const { expression } = args;
try {
const solved = math.eval(expression);
return msg.say(solved)
.catch(() => msg.say('Invalid statement.'));
} catch(err) {
return msg.say('Invalid statement.');
}
}
};