1.0.1 • Published 6 years ago
vk-post-bot v1.0.1
Vk post bot
Bot that adds posts to community wall
Usage
const bot = new VkPostBot("<access_token>");
bot.post({
"ownerId": "-1",
"friendsOnly": "1",
"fromGroup": "1",
"message": "test message",
"attachments": "https://example.com/"
});
Documentation
Table of Contents
VkPostBot
Class represents bot that adds post on wall
Parameters
token
String access token
post
Add post on community wall
Parameters
params
{Object} - Parameters of postparams.ownerId
(Required) community ID - negative valueparams.friendsOnly
1 — post will be available to friends only, 0 — post will be available to all users (default)params.fromGroup
1 — post will be published by the community, 0 — post will be published by the user (default)params.message
(Required if attachments is not set.) Text of the post.params.attachments
(Required if message is not set.) List of objects attached to the post
ErrorBadRequest
Extends Error
Class represents custom error for Bad Request
Parameters
message
(string | null) error message (optional, defaultnull
)