rasa/core/channels/telegram.py
async def send_text_with_buttons(self, recipient_id, text,
                                     buttons, button_type="inline", **kwargs):
        """Sends a message with keyboard.

        For more information: https://core.telegram.org/bots#keyboards

        :button_type inline: horizontal inline keyboard

        :button_type vertical: vertical inline keyboard

        :button_type custom: custom keyboard
        """
        if button_type == "inline":
            button_list = [[InlineKeyboardButton(s["title"],
                                                 callback_data=s["payload"])
                            for s in buttons]]
            reply_markup = InlineKeyboardMarkup(button_list)

        elif button_type == "vertical":
            button_list = [[InlineKeyboardButton(s["title"],
                                                 callback_data=s["payload"])]
                           for s in buttons]
            reply_markup = InlineKeyboardMarkup(button_list)

        elif button_type == "custom":
            button_list = []
            for bttn in buttons:
                if isinstance(bttn, list):
                    button_list.append([KeyboardButton(s['title'])
                                        for s in bttn])
                else:
                    button_list.append([KeyboardButton(bttn["title"])])
            reply_markup = ReplyKeyboardMarkup(button_list,
                                               resize_keyboard=True,
                                               one_time_keyboard=True)
        else:
            logger.error('Trying to send text with buttons for unknown '
                         'button type {}'.format(button_type))
            return

        self.send_message(recipient_id, text, reply_markup=reply_markup)
Sends a message with keyboard.

        For more information: https://core.telegram.org/bots#keyboards

        :button_type inline: horizontal inline keyboard

        :button_type vertical: vertical inline keyboard

        :button_type custom: custom keyboard
        
Sends a message with keyboard.
Sends a message with keyboard .
async def send_text_with_buttons(self, recipient_id, text,
                                     buttons, button_type="inline", **kwargs):
        if button_type == "inline":
            button_list = [[InlineKeyboardButton(s["title"],
                                                 callback_data=s["payload"])
                            for s in buttons]]
            reply_markup = InlineKeyboardMarkup(button_list)
        elif button_type == "vertical":
            button_list = [[InlineKeyboardButton(s["title"],
                                                 callback_data=s["payload"])]
                           for s in buttons]
            reply_markup = InlineKeyboardMarkup(button_list)
        elif button_type == "custom":
            button_list = []
            for bttn in buttons:
                if isinstance(bttn, list):
                    button_list.append([KeyboardButton(s['title'])
                                        for s in bttn])
                else:
                    button_list.append([KeyboardButton(bttn["title"])])
            reply_markup = ReplyKeyboardMarkup(button_list,
                                               resize_keyboard=True,
                                               one_time_keyboard=True)
        else:
            logger.error('Trying to send text with buttons for unknown '
                         'button type {}'.format(button_type))
            return
        self.send_message(recipient_id, text, reply_markup=reply_markup)
async def send_text_with_buttons ( self , recipient_id , text , buttons , button_type = "inline" , ** kwargs ) : if button_type == "inline" : button_list = [ [ InlineKeyboardButton ( s [ "title" ] , callback_data = s [ "payload" ] ) for s in buttons ] ] reply_markup = InlineKeyboardMarkup ( button_list ) elif button_type == "vertical" : button_list = [ [ InlineKeyboardButton ( s [ "title" ] , callback_data = s [ "payload" ] ) ] for s in buttons ] reply_markup = InlineKeyboardMarkup ( button_list ) elif button_type == "custom" : button_list = [ ] for bttn in buttons : if isinstance ( bttn , list ) : button_list . append ( [ KeyboardButton ( s [ 'title' ] ) for s in bttn ] ) else : button_list . append ( [ KeyboardButton ( bttn [ "title" ] ) ] ) reply_markup = ReplyKeyboardMarkup ( button_list , resize_keyboard = True , one_time_keyboard = True ) else : logger . error ( 'Trying to send text with buttons for unknown ' 'button type {}' . format ( button_type ) ) return self . send_message ( recipient_id , text , reply_markup = reply_markup )
Sends a message with keyboard.
Sends a message with keyboard .
"""Sends a message with keyboard.

        For more information: https://core.telegram.org/bots#keyboards

        :button_type inline: horizontal inline keyboard

        :button_type vertical: vertical inline keyboard

        :button_type custom: custom keyboard
        """
self
recipient_id
text
buttons
button_type
button_type
horizontal inline keyboard
horizontal inline keyboard
button_type
vertical inline keyboard
vertical inline keyboard
button_type
None