K
K
Kendric Folkin2021-01-25 16:54:18
Python
Kendric Folkin, 2021-01-25 16:54:18

How to add callback button with show_snackbar?

The button with show_snackbar does not work, there are no errors, just an endless loading when you click on the button
Need help, code snippet below, if it is not enough and you need something else, write

elif body.lower() == "":
          keyboard = VkKeyboard(one_time=False, inline=False)
          keyboard.add_button("кнопка1", color=VkKeyboardColor.POSITIVE)
          keyboard.add_button("кнопка2", color=VkKeyboardColor.POSITIVE)
          keyboard.add_line()
          keyboard.add_button("кнопка3", color=VkKeyboardColor.PRIMARY)
          keyboard.add_line()
          keyboard.add_callback_button(label='Покажи pop-up сообщение', color=VkKeyboardColor.SECONDARY, payload={"type": "show_snackbar", "text": "Это исчезающее сообщение"})
          keyboard.add_openlink_button("кнопка5", "-", payload=None)
          vk.method("messages.send", {"peer_id": id, "message": "пункты", "keyboard": keyboard.get_keyboard(), "random_id": random.randint(1, 2147483647)})

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question