Why InputFieldState does not work in viberbot 1.0.12

40 Views Asked by At

I expected the field to disappear from the user interface, but it remains How do I remove the field for input field?

def handle_message(sender_id):
    message = KeyboardMessage(keyboard=create_menu())
    viber_api.send_messages(sender_id, [message])
def create_menu():
    keyboard = {
        "Type": "keyboard",
        "InputFieldState": "hidden",
        "Buttons": [
            {
                "Columns": 2,
                "Rows": 1,
                "BgColor": "#e6f5ff",
                "Text": "<b>Button 1</b>",
                "TextSize": "large",
                "TextVAlign": "middle",
                "TextHAlign": "center",
                "ActionType": "reply",
                "ActionBody": "button1",
                "Silent": True
            },
        ],
    }

    return keyboard

I expected the keyboard to disappear from the user interface, but it remains

1

There are 1 best solutions below

0
On

I should have added the argument min_api_version=6 to KeyboardMessage

message = KeyboardMessage(keyboard=create_menu(), min_api_version=6)