K
K
KarToSHKa_Ex2018-10-24 08:13:02
Python
KarToSHKa_Ex, 2018-10-24 08:13:02

Sending messages to a vk_api conversation?

There is a bot for VK written in python. There are keys by which he answers questions. And how to add to it so that he answers in a conversation too. Responds only to PM. Peer_id it takes the id of the user who wrote to him and replies. def create_answer
(data, token):
load_modules()
peer_id =data['peer_id']
message, attachment = get_answer(data['text'].lower())
vkapi.send_message(peer_id, token, message, attachment)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
toNN4eg, 2018-11-02
@toNN4eg

Perhaps the problem is that the bot does not see messages in the conversation, in the list of users of the conversation, you must give the bot either an administrator or access to all correspondence.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question