New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to start? #133
Comments
The import works only with MJS, TypeScript or Babel preprocessing. Here you need to use Common JS: const { VK } = require('vk-io');
const vk = new VK();
vk.token = 'asdfasdfadsf';
const collectStream = vk.collect.wall.get({ owner_id: -86529522 }); |
negezor, thanks! It works!
I'm using up-to-date version of vk-io. |
Maybe the fact is that the vk object is used at the beginning? const collectStream = vk.collect.wall.get({ owner_id: -86529522 });
collectStream.on('error', console.error);
collectStream.on('data', payload => {
console.log('Data', payload.items);
});
collectStream.on('end', () => {
console.log('Data received');
}); |
Is there any little example on how to get messages from a wall of a group? |
You can get posts from a group using the wall.get method, but it is not available for the group token. If there is a token, you need to using it only in the options. const group = new VK({
token: 'GROUP_TOKEN'
});
const app = new VK({
token: 'APP_TOKEN_OR_USER_TOKEN'
});
// Method
app.api.wall.get({
owner_id: -86529522 // Group ID
}); // => Promise
// Or collect all
app.collect.wall.get({
owner_id: -86529522
}); // => CollectStream The collection works with a user or application token. But only if the method supports. |
Thanks! |
Application token (Service Token). User token available via standalone or direct authorization. These are all tokens, have their permissions to call methods. |
What token (and auth method) do I need to make wall.get requests? My sample code now is:
But everytime I get a following message: Looks I can't just make simple wall.get request :) |
I have "node v11.10.0" + MacOS 10.14.
Unfortunately I can't start VK-io because of these errors:
So I tried something else but again I've not succeed with that approach:
What do I do wrong?
The text was updated successfully, but these errors were encountered: