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

557
Views
How to use editMessageText with the Telegraf framework?

I have to edit a message when an inline button is pressed. Here is my code:

bot.action("option2", (ctx) => {
  ctx.answerCbQuery();

  bot.telegram.editMessageText(
    ctx.update.callback_query.message.chat.id,
    ctx.update.callback_query.message.message_id,
    `Hello`
  );
});

I'm getting the error:

{
  response: {
    ok: false,
    error_code: 400,
    description: 'Bad Request: message text is empty'  
  },
  on: {
    method: 'editMessageText',
    payload: {
      text: undefined,
      chat_id: 'Hello',
      message_id: { chat_id: -684957676, message_id: 578 },
      inline_message_id: undefined
    }
  }
}

I'm using the Telegraf framework

I believe that I don't understand the order in which I should pass arguments.

How do I use the editMessageText?

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

0

You don't have to make it complex this way.

Just do this:

ctx.editMessageText('Hello')
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!