B
B
BlackDog052019-08-16 13:26:06
Python
BlackDog05, 2019-08-16 13:26:06

How to make a notification about new entries in VK in Python?

Hello, I would like my community to notify the PM about new entries, but something does not work ...
Thanks in advance!

elif data["type"] == "wall_post_new":
        object = data["object"]
        peer_id = "Мой Id"
        id = object["id"] #Id Записи
        vk.method("messages.send", {"peer_id": peer_id, "message": "Новая запись!", "attachment": "wall-Id Сообщества_"+id, "random_id": random.randint(1, 2147483647)})
    time.sleep(1)
    return "ok"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lightmanLP, 2019-08-20
@BlackDog05

Your id can be a str rather than an int. Perhaps the problem is this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question