How to hide ReplyKeyboardMarkup after user click in Telegram Bot API

后端 未结 3 1884
野趣味
野趣味 2021-02-08 02:52

I am using Node.js telegram-bot-api.

Idea:

  1. Show a custom keyboard with one button - \"Share my phone number\".
  2. When user clicks this button, conta
相关标签:
3条回答
  • 2021-02-08 03:25

    Found it.

    Here is a solution:

    bot.sendMessage({
        chat_id: message.chat.id,
        text: 'Some text...',
        reply_markup: JSON.stringify({
            hide_keyboard: true
        })
    });
    
    0 讨论(0)
  • 2021-02-08 03:28

    You should use editMessageReplyMarkup and update that message's replyMarkup with null string('') after client user's click recieved.

    UPDATE this is applicable for inline keyboards.

    0 讨论(0)
  • 2021-02-08 03:32

    hide_keyboard has been renamed to remove_keyboard since API 2.3.

    bot.sendMessage({
        chat_id: message.chat.id,
        text: 'Some text...',
        reply_markup: JSON.stringify({
            remove_keyboard: true
        })
    });
    
    0 讨论(0)
提交回复
热议问题