Skip to content

finnishfox/vk-post-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

Releases

No releases published

Packages

No packages published