
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
vk-fast-longpoll
Advanced tools
RU | Мощный инструмент для работы с VK API, который работает в 25 раз быстрее обычных вызовов API методов.
EN | Powerfull tool for VK api that works 25 times faster then usual api calls
npm install vk-fast-longpoll --save
const VK = require('vk-fast-longpoll');
const group = new VK('token here');
group.longpoll.start();
group.longpoll.on('message', (message) => {
if(!message.isOutbox)
{
//Отвечаем на сообщение
}
});
Все методы VK должны вызываться с префиксом api например
group.api.messages.send({user_id: 1, message: 'Привет, Паша'});
Методы возвращают Promise-ы, поэтому стоит добавлять обработчик ошибок к каждому вызову.
group.api.messages.send({user_id: 1, message: 'Привет, Паша'}).catch(console.error);
Все названия методов, а также названия полей полностью соответсвуют названиям из документации VK
const VK = require('vk-fast-longpoll');
const group = new VK('token here');
group.longpoll.start();
group.longpoll.on('message', (message) => {
if(!message.isOutbox)
{
group.api.messages.send({user_id: message.sender, message: message.text}).then(() => {
console.log(message.text);
}).catch(console.error);
}
});
//В разработке
npm install vk-fast-longpoll --save
const VK = require('vk-fast-longpoll');
const group = new VK('token here');
group.longpoll.start();
group.longpoll.on('message', (message) => {
if(!message.isOutbox)
{
//Reply message
}
});
All VK Api methods must be called with api
prefix
group.api.messages.send({user_id: 1, message: 'Hello, Pasha'});
All methods return Promises, therefor you need to catch errors in every api call.
group.api.messages.send({user_id: 1, message: 'Hello, Pasha'}).catch(console.error);
All methods names and fields names are equal as VK Api docs
const VK = require('vk-fast-longpoll');
const group = new VK('token here');
group.longpoll.start();
group.longpoll.on('message', (message) => {
if(!message.isOutbox)
{
group.api.messages.send({user_id: message.sender, message: message.text}).then(() => {
console.log(message.text);
}).catch(console.error);
}
});
//In development
FAQs
VK Lib for better performance
We found that vk-fast-longpoll demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.