Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-vk-bot-api

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-vk-bot-api - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

32

index.js

@@ -68,19 +68,21 @@ const request = require('request');

this.getForwardMessage(updates).then(data => {
const update = (Object.keys(data).length == 3)
? { user_id: updates[3], date: data.date, msg: data.body }
: { user_id: updates[3], date: data[4], msg: data[6] };
if (data.body || data[3]) {
const update = (Object.keys(data).length == 3)
? { user_id: updates[3], date: data.date, msg: data.body }
: { user_id: updates[3], date: data[4], msg: data[6] };
if (action.commands[update.msg.toLowerCase()]) {
action.commands[update.msg.toLowerCase()](update);
} else {
if (Object.keys(action.hears).length) {
Object.keys(action.hears).forEach((cmd, i) => {
if (new RegExp(cmd, 'i').test(update.msg.toLowerCase())) {
action.hears[cmd](update);
} else if (i == Object.keys(action.hears).length - 1) {
action.reserve(update);
}
});
if (action.commands[update.msg.toLowerCase()]) {
action.commands[update.msg.toLowerCase()](update);
} else {
action.reserve(update);
if (Object.keys(action.hears).length) {
Object.keys(action.hears).forEach((cmd, i) => {
if (new RegExp(cmd, 'i').test(update.msg.toLowerCase())) {
action.hears[cmd](update);
} else if (i == Object.keys(action.hears).length - 1) {
action.reserve(update);
}
});
} else {
action.reserve(update);
}
}

@@ -87,0 +89,0 @@ }

{
"name": "node-vk-bot-api",
"version": "0.3.2",
"version": "0.3.3",
"description": "Clean API for VK bots based on long poll with multi-dispatch send messages (~75 per second).",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc