Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

127
Views
Cómo hacer que mi bot no responda a sí mismo

Creé un bot que dice una pregunta cuando se reconoce un determinado mensaje de chat y piensa si el siguiente mensaje de chat es la respuesta correcta o no. Pero el bot piensa que la pregunta que dijo es la respuesta incorrecta y dice que no es correcta.

 //setup & createbot const mineflayer = require('mineflayer') var settings = { username: "Bot", host: "localhost", port: 64390, }; const bot = mineflayer.createBot(settings); //question bot.on('chat', function(username, message) { if (message==='problem'){ bot.chat('What is the color of apple?') let state = true state=true while (state){ if (message==='red or green'){ bot.chat('correct.') state = false }else{ bot.chat('incorrect.') state=false } } } }); bot.on('kicked', console.log) bot.on('error', console.log)
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Agregar

 if (username === bot.username) return

A la parte superior de la función

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!