F
F
FinnJI2018-09-30 18:29:27
Python
FinnJI, 2018-09-30 18:29:27

What to do if the community in VK does not see messages from the conversation even through the mention?

I wrote the simplest VK bot, but if you connect it not to the page but to the VK group, then the bot starts responding only in PM, and he absolutely does not see the conversation, although I gave him administrative rights and access to all correspondence (even in section of messages, for admins, conversations do not appear). The bot was written using Long Poll, the api settings are set to version 5.85 and the rights to all events have been granted. I'm running the bot from PyCharm.
Here is the code:

import vk_api
from vk_api.longpoll import VkLongPoll, VkEventType


def main():

    vk_session = vk_api.VkApi(token='тут токен')
    vk = vk_session.get_api()

    longpoll = VkLongPoll(vk_session)

    for event in longpoll.listen():
        if event.type == VkEventType.MESSAGE_NEW and event.to_me and event.text:
            text=event.text
            if text.lower() == 'привет':
                vk.messages.send(
                    peer_id=event.peer_id,
                    message='Привет!')

if __name__ == '__main__':
    main()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bqio, 2018-09-30
@FinnJI

groups.getLongPollServer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question