Nurturing Palpable Magnificence
    Have ideas to improve npm?Join in the discussion! »

    vk-plus-plus

    1.0.5 • Public • Published

    VK API Logo

    vk-plus-plus

    NPM Version Downloads

    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 queries
    • stopBot() - Stops longpoll
    • on(eventName, listener) - Add event listener. Event description
    • other methods can be found on official VK Developers page

    Install

    npm i vk-plus-plus

    DownloadsWeekly Downloads

    1

    Version

    1.0.5

    License

    MIT

    Unpacked Size

    61.3 kB

    Total Files

    44

    Last publish

    Collaborators

    • avatar