rasa/core/channels/channel.py
def button_to_string(button, idx=0):
    """Create a string representation of a button."""

    title = button.pop('title', '')

    if 'payload' in button:
        payload = " ({})".format(button.pop('payload'))
    else:
        payload = ""

    # if there are any additional attributes, we append them to the output
    if button:
        details = " - {}".format(json.dumps(button, sort_keys=True))
    else:
        details = ""

    button_string = "{idx}: {title}{payload}{details}".format(
        idx=idx + 1,
        title=title,
        payload=payload,
        details=details)

    return button_string
Create a string representation of a button.
Create a string representation of a button.
Create a string representation of a button .
def button_to_string(button, idx=0):
    title = button.pop('title', '')
    if 'payload' in button:
        payload = " ({})".format(button.pop('payload'))
    else:
        payload = ""
    if button:
        details = " - {}".format(json.dumps(button, sort_keys=True))
    else:
        details = ""
    button_string = "{idx}: {title}{payload}{details}".format(
        idx=idx + 1,
        title=title,
        payload=payload,
        details=details)
    return button_string
def button_to_string ( button , idx = 0 ) : title = button . pop ( 'title' , '' ) if 'payload' in button : payload = " ({})" . format ( button . pop ( 'payload' ) ) else : payload = "" if button : details = " - {}" . format ( json . dumps ( button , sort_keys = True ) ) else : details = "" button_string = "{idx}: {title}{payload}{details}" . format ( idx = idx + 1 , title = title , payload = payload , details = details ) return button_string
Create a string representation of a button.
Create a string representation of a button .
"""Create a string representation of a button.""" # if there are any additional attributes, we append them to the output
button
idx