vk-plus-plus
v1.0.5
Published
Comfortable and fast VK API accessor
Downloads
27
Maintainers
Readme
vk-plus-plus
Simple and fast VK api with Long Poll support
Install
$ npm i vk-plus-plus -s
Example
const VK = require('vk-plus-plus');
const bot = new VK({
token: '<your tokenhere>',
version: '5.80',
useExecute: true //25 times increase api calls speed in highloaded projects
});
bot.on('message_new', (message) => {
if(message.text.toLowerCase().trim() == 'hello') {
bot.messages.send({
user_id: message.from_id,
message: 'hello'
}).then((message_id) => {
console.log('Message successfully sent. Message ID = ' + message_id);
bot.stopBot();
})
}
});
bot.startBot();
Methods
startBot()
- Just starts longpoll queriesstopBot()
- Stops longpollon(eventName, listener)
- Add event listener. Event description- other methods can be found on official VK Developers page