K
K
korjio2020-05-28 23:40:52
Python
korjio, 2020-05-28 23:40:52

How to add feedback to the VK bot?

I am writing a bot for the VKontakte group. A new question has appeared. I want to add a feedback function:
A person writes "feedback" and his next message is sent to the group administrator. When I tried to implement this, another problem arose: I have a command

else:
          send_message(vk_session, 'user_id', event.user_id, message='Я вас не понимаю. Воспользуйтесь клавиатурой')

and when entering a question for feedback, the user receives this message. Help solve the problem please. Preferably with sample code

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WolfInChains, 2020-05-29
@korjio

Something like this? The user writes, for example, "Report an error in the word on the button" and the admin receives the message "New report: error in the word on the button." You can also attach an id / link to the user

text_1 = event.obj['text'].split(' ', maxsplit=1)
if text_1[0] == "Репорт":
        vk.method("messages.send",
                                 {
                                     "user_id": тут айди админа,
                                     "message": "Новый репорт: " + f'{text_1[1]}',
                                     "random_id": 0
                                 })

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question