Answer the question
In order to leave comments, you need to log in
How to use new_wall_post vk api event?
Hello, tell me how to make some text appear in the console when new entries are made?
Module: vk-io
Language: node.js
const fs = require("fs")
const VK = require('vk-io')
const vk = new VK()
vk.setToken("Токен")
vk.longpoll.start()
console.log("gg!");
vk.longpoll.on("wall_post_new", (context) => {
console.log("анеме!");
});
Answer the question
In order to leave comments, you need to log in
Because the 3.2 library doesn't support the Bots Long Poll/Callback API. Here is an example for the latest version 4.0.
const { VK } = require('vk-io');
const vk = new VK({
token: 'Токен'
});
vk.updates.on('wall_post', (context) => {
console.log("анеме!");
});
vk.updates.start();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question