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

699
Views
¿Por qué recibo un error 400 cuando intento editar un teclado en línea (node-telegram-bot-api)?

Estoy haciendo un mensaje con un teclado en línea simple. El resultado esperado sería que cuando hago clic en el botón cambia junto con el texto del mensaje.

Sin embargo, el botón no cambia y me sale este error:

 TelegramError: ETELEGRAM: 400 Bad Request: message is not modified: specified new message content and reply markup are exactly the same as a current content and reply markup of the message

Estoy usando el paquete node-telegram-bot-api.

El código que tiene que cambiar mi teclado es:

 let info_message = { text: "some info boi", keyboard: { reply_markup: { inline_keyboard: [ [{ text: 'Start', callback_data: '!/start' }] ] } } } client.on("callback_query", async (cb) => { if (cb.data === "!/info") { const msg = cb.message; const opts = { chat_id: msg.chat.id, message_id: msg.message_id, }; await client.editMessageReplyMarkup(info_message.keyboard, opts); await client.editMessageText(info_message.text, opts); } })

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Descubrí el error.

El método editMessageReplyMarkup() requiere el parámetro replyMarkup , un objeto serializado JSON para un teclado en línea.

Mi error fue que di todo el answer_markup mientras que me pidieron que diera solo el inline_keyboard. El código ahora se ve así:

 client.on("callback_query", async (cb) => { if (cb.data === "!/info") { const msg = cb.message; const opts = { chat_id: msg.chat.id, message_id: msg.message_id, }; await client.editMessageReplyMarkup(info_message.keyboard.reply_markup, opts); // I gave info_message.keyboard.reply_markup as input, instead of info_message.keyboard await client.editMessageText(info_message.text, opts); } })

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!