node-vk-bot-api
Advanced tools
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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13920
216