¿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); } } //}) //})}