1.0.1 • Published 6 years ago

vk-post-bot v1.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

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

post

Add post on community wall

Parameters

  • params {Object} - Parameters of post
    • params.ownerId (Required) community ID - negative value
    • params.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, default null)