Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

257
Visualizações
How to make discord bot calc with javascript?

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 !

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

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);

})
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda