MCPcopy Create free account
hub / github.com/eternnoir/pyTelegramBotAPI / ReplyKeyboardMarkup

Class ReplyKeyboardMarkup

telebot/types.py:2693–2832  ·  view source on GitHub ↗

This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). .. code-block:: python3 :caption: Example on creating ReplyKeyboardMarkup object from telebot.types import ReplyKeyboardMarkup, KeyboardButton markup =

Source from the content-addressed store, hash-verified

2691
2692# noinspection PyUnresolvedReferences
2693class ReplyKeyboardMarkup(JsonSerializable):
2694 """
2695 This object represents a custom keyboard with reply options (see Introduction to bots for details and examples).
2696
2697 .. code-block:: python3
2698 :caption: Example on creating ReplyKeyboardMarkup object
2699
2700 from telebot.types import ReplyKeyboardMarkup, KeyboardButton
2701
2702 markup = ReplyKeyboardMarkup(resize_keyboard=True)
2703 markup.add(KeyboardButton('Text'))
2704 # or:
2705 markup.add('Text')
2706
2707 # display this markup:
2708 bot.send_message(chat_id, 'Text', reply_markup=markup)
2709
2710 Telegram Documentation: https://core.telegram.org/bots/api#replykeyboardmarkup
2711
2712 :param keyboard: :obj:`list` of button rows, each represented by an :obj:`list` of
2713 :class:`telebot.types.KeyboardButton` objects
2714 :type keyboard: :obj:`list` of :obj:`list` of :class:`telebot.types.KeyboardButton`
2715
2716 :param resize_keyboard: Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make
2717 the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is
2718 always of the same height as the app's standard keyboard.
2719 :type resize_keyboard: :obj:`bool`
2720
2721 :param one_time_keyboard: Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard
2722 will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can
2723 press a special button in the input field to see the custom keyboard again. Defaults to false.
2724 :type one_time_keyboard: :obj:`bool`
2725
2726 :param input_field_placeholder: Optional. The placeholder to be shown in the input field when the keyboard is
2727 active; 1-64 characters
2728 :type input_field_placeholder: :obj:`str`
2729
2730 :param selective: Optional. Use this parameter if you want to show the keyboard to specific users only. Targets:
2731 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message
2732 in the same chat and forum topic, sender of the original message. Example: A user requests to change the bot's
2733 language, bot replies to the request with a keyboard to select the new language. Other users in the group don't
2734 see the keyboard.
2735 :type selective: :obj:`bool`
2736
2737 :param is_persistent: Optional. Use this parameter if you want to show the keyboard to specific users only.
2738 Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a
2739 reply (has reply_to_message_id), sender of the original message.
2740
2741 Example: A user requests to change the bot's language, bot replies to the request with a keyboard to
2742 select the new language. Other users in the group don't see the keyboard.
2743
2744 :return: Instance of the class
2745 :rtype: :class:`telebot.types.ReplyKeyboardMarkup`
2746 """
2747 max_row_keys = 12
2748
2749 def __init__(self, resize_keyboard: Optional[bool]=None, one_time_keyboard: Optional[bool]=None,
2750 selective: Optional[bool]=None, row_width: int=3, input_field_placeholder: Optional[str]=None,

Callers 5

startFunction · 0.90
keyboardFunction · 0.90
menu_keyboardFunction · 0.90
startFunction · 0.90
menu_keyboardFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…