G
G
glo0m2021-11-23 19:41:23
Python
glo0m, 2021-11-23 19:41:23

The bot does not respond to buttons in a VK conversation. What to do?

Hello! I am writing a bot for personal purposes and decided to test it in a conversation. I made buttons and when you click on the button in the conversation, the text of the button is sent, but before the text there is a mention of the bot. Because of this, the bot does not respond. What should I do or how can I fix this? Everything works in private messages.

def menu():
global keyboard1
keyboard1 = VkKeyboard(inline=True)
keyboard1.add_button(' Profile', color=VkKeyboardColor.NEGATIVE)
keyboard1.add_line()
keyboard1.add_button(' Work', color=VkKeyboardColor.PRIMARY)
keyboard1. add_button(' Miners', color=VkKeyboardColor.POSITIVE)
keyboard1.add_line()
keyboard1.add_button(' Family', color=VkKeyboardColor.POSITIVE)
keyboard1.add_button(' Garage', color=VkKeyboardColor.PRIMARY)


if event.text == 'Start' or event.text == 'Menu' or event.text == 'Open':
menu()
vk.messages.send(peer_id=event.peer_id, random_id=0, message=' What are you interested in?', keyboard=keyboard1.get_keyboard())

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Melnikov, 2021-11-23
@Mi11er

1) Write a question in qna without code and error
2) Wait for a miracle...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question