How to hide or delete inline buttons?

See original GitHub issue

Is there a way to delete/hide/remove the inline buttons after user clicks it? Below is the code I use to send the message with inline buttons:

bot.sendMessage(msg.chat.id, 'Yes or no?', {
      reply_markup: {
        inline_keyboard: [[
          {
            text: `Yes`,
            callback_data: '1'
          },
          {
            text: 'No',
            callback_data: '0'
          }
        ]]
      }
    })

If I do an attempt to call editMessageReplyMarkup with an empty reply_markup - it just won’t let me do so, return a 400 status code and error saying message can't be edited. Telegram docs say:

Please note, that it is currently only possible to edit messages without reply_markup or with inline keyboards.

So I’m not entirely sure how to achieve my goal. Any thoughts?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:8

github_iconTop GitHub Comments

8reactions
ivomarsancommented, Oct 17, 2017

Just add:

bot.on('callback_query', (msg) => {
  bot.sendMessage(_.id, `Selected '${msg.data}'`);
  bot.deleteMessage(_.id, msg.message.message_id);
});`
3reactions
MSCSllBenzcommented, Aug 24, 2019

Can you show me how to use editMessageReplyMarkup?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to hide or delete inline button after click? - Stack Overflow
To change inline keyboard of sent message, use editMessageReplyMarkup method. Just provide a new version of inline keyboard in reply_markup ...
Read more >
Hide the View button in Inline REF_ROW
The option you have is to make the View localization to "" (blank) based on the view you want it to be hidden....
Read more >
How to Hide or Delete Radio Buttons in a matrix table
Hello! How can I hide or delete those 2 radio buttons next from "Leave/Time Off". I already tried using custom CSS in the...
Read more >
How to hide the Delete button in Incident form based on Role?
Hi I have a Requirement like Only admin will be able to get/see the Delete button in incident form. For other Users it...
Read more >
Add, change, hide, or delete comments in a presentation
Learn how to add, delete, hide, or edit comments in PowerPoint presentations, especially if you're collaborating with others.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found