W
W
WazzzUp10022019-10-11 22:41:41
Python
WazzzUp1002, 2019-10-11 22:41:41

How to catch an event in a specific VK group through wall.get?

There is a bot written in python, vkbot_longpoll. I can’t figure out how to make the bot follow a certain group and if a new entry appears there, send me a message to the console.
Here is part of the code:

while True:
    try:
        for event in longPoll.listen():
            if event.type == VkBotEventType.MESSAGE_NEW:
                from_id = event.obj['from_id']  # id пользователя, который отправил сообщение
                peer_id = event.obj['peer_id']  # peer_id беседы или ЛС, откуда пришло сообщение

                if "Кулл" == message and (from_id in ids_admins):
                    cool()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vkulik79, 2019-11-05
@vkulik79

MESSAGE_NEW is a message event, why do you need it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question