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

150
Views
La condición se repite cada vez. ¿Cómo cumplir la condición una sola vez? robot de telegrama

¿Cuáles son los errores en esta condición, porque se repite? 'evento 7' es el botón. Todo sucede en una función asíncrona. Tengo siete condiciones (siete botones). Cada botón se repite después de presionarlo una vez, pero la séptima condición se repite cada vez y cierra el chat. No puedo poner más código ¿Cómo mejorar esto?

 if (msg.text === 'event 7') { await bot.sendMessage(msg.chat.id, 'message 15', { reply_markup: { remove_keyboard: true } }) await bot.sendMessage(msg.chat.id, 'message 16') await bot.sendMessage(msg.chat.id, 'message 17', { reply_markup: { keyboard: [ ['yes'], ['no'], ] } }) const Cabel = msg.text if (Cabel) { const query = `INSERT INTO socialobject (Cabel) Value '%${Cabel}%'`; //await sequelize.query(query); } //bot.on('message', async msg => { if (msg.text === 'yes' || 'no') { await bot.sendMessage(msg.chat.id, 'message 18', { reply_markup: { remove_keyboard: true } }) await bot.sendMessage(msg.chat.id, 'object 1') await bot.sendMessage(msg.chat.id, 'object 2') await bot.sendMessage(msg.chat.id, 'object 3') await bot.sendMessage(msg.chat.id, 'object 4') await bot.sendMessage(msg.chat.id, 'object 5') await bot.sendMessage(msg.chat.id, 'object 6') await bot.sendMessage(msg.chat.id, 'object 7') await bot.sendMessage(msg.chat.id, 'message 19', { reply_markup: { keyboard: [ ['yes'], ['no'], ] } }) const socialObjects = msg.text if (socialObjects) { const query = `INSERT INTO socialobject (socialObjects) Value '%${socialObjects}%'`; //await sequelize.query(query); } } //bot.on('message', async msg => { if (msg.text === 'yes' || 'no') { await bot.sendMessage(msg.chat.id, 'message 20', { reply_markup: { remove_keyboard: true } }) await bot.sendMessage(msg.chat.id, 'message 21', { reply_markup: { keyboard: [ ['yes'], ['no'], ] } }) const socialObjectName = msg.text if (socialObjectName) { const query = `INSERT INTO socialobject (socialObjectName) Value '%${socialObjectName}%'`; //await sequelize.query(query); } } //}) //})

}

about 4 years ago · Juan Pablo Isaza
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!