![](https://sun9-17.userapi.com/impg/RezfgyBkpS_juJs4Wy9kLV6jPkKxKiQk3_y8TQ/zbsbm6INxn4.jpg?size=225x225&quality=96&sign=5be45842c90d1c95631f148718aa48aa&c_uniq_tag=nUvHehKRj7X2DVzokCC-MJEeAK7iZbU6YR8ZSylxqLU&type=album)
![](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)
![](https://img.shields.io/npm/dt/vksnake.svg)
📦 Installation
Node.js 12.20.0 or newer is required
-
Using Yarn
(recommended)
yarn add vksnake
-
Using npm
npm i vksnake
-
Using pnpm
pnpm add vksnake
-
Usage to methods VK
import { Method, VK } from 'vksnake';
const vk = new VK({
token: process.env.TOKEN
})
async function method () {
const body = await new Method().use('users.get', {
user_id: 501
})
console.log(body)
}
method ()
import { Method, VK } from 'vksnake';
const vk = new VK({
token: process.env.TOKEN
})
async function method () {
const body = await new Method().use('wall.get', {
owner_id: 1
})
console.log(body)
}
method ()
Usage to method
import { Method, VK } from 'vksnake';
const vk = new VK({
token: process.env.TOKEN
})
async function method () {
const body = await new Method().getInfoUser(501, { user_id: 501 })
console.log(body)
}
method()
Send message in chat
import { Method, VK, getRandomId } from 'vksnake';
const vk = new VK({
token: ''
})
async function method () {
const body = await new Method().use('messages.send', {
random_id: getRandomId(),
peer_id: ...userId or chatId,
message: 'Привет'
})
console.log(body)
}
async function method () {
const body = await new Method().send('Привет', {
senderId: ...userId or chatId
})
console.log(body)
}
Checking token
import { Method, VK } from 'vksnake';
const vk = new VK({
token: process.env.TOKEN
})
const body = new Method().secretSnake();
console.log(body)
API Limite
const { VK, Method, API, APILimite } = require('vksnake');
const vk = new VK({
token: process.env.TOKEN
});
async function getInfo () {
const body = await new Method().use('users.get', { user_id: 501 });
console.log(body)
}
const body = new API({
apiType: 'slize',
limite: 2
});
const confrim = new APILimite(body);
async function get () {
const value = confrim.limite();
console.log(value)
}
get()
console.log(confrim)
Support
Пожертвовать / Support
Ник QIWI: NODEJSLUPUS
Contacts
- VK
- GitHub