I'm new to this ,i am looking for simple mathematics command on discord.js im building a simple bot for myself .I want him to calc simple task like : Some Call !Calc 35.5 768.99 666566.3 and the bot calc the first Num1 with preset number like !Calc 10.5 21 30.5 and it will answer back 10.5x3 ---> 31.5 , 21x10 ---> 210 , 30.5/3 ---> 10.16666666 preset number are *3 *10 and /3 ... I'm already running a bot with the basic setup that he answer back at !ping etc... Thanks in advance !
You can try using mathjs, you can download it with nodejs.
By npm install maths in your terminal.
You may check out documentation here.
Here is the template I have made in reference of mathjs.
const math = require('mathjs');
client.on('messageCreate', (message) => {
let Equation = message.content.substring(message.content.indexOf(" ")).slice(1);
let resp = math.evaluate(Equation);
})