1.0.6-rc-1 • Published 4 years ago
vk-io-longpoll v1.0.6-rc-1
vk-io-longpoll
Description/Описание
EN VK LongPoll is a module created to automatically configure LongPoll in the Vkontakte group. RU VK LongPoll - Это модуль, созданный для автоматической настройки LongPoll в группе Вконтакте.
Installation/Установка
npm i vk-io-longpoll
Документация
Examples of using in place with VK-IO
const { VK, Keyboard } = require('vk-io')
const { LongPoll } = require('vk-io-longpoll');
const vk = new VK({
token: process.env.TOKEN
apiMode: 'sequential',
pollingGroupId: 123456789
})
const pool = new LongPoll({
token: process.env.TOKEN
group_id: 123456789
})
const { updates } = vk;
updates.start()
.then(() => {
console.log('Bot Started')
})
.catch((e) => {
if(e.toString(/(№100)/ig, 'LongPoll')) {
console.log('Configure LongPoll : )');
pool.longpoll();
return;
}
console.error('Error: \n'+ error)
})
...