Socket
Socket
Sign inDemoInstall

node-vk-bot-api

Package Overview
Dependencies
3
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.4.3 to 2.4.5

30

lib/stage.js

@@ -12,21 +12,25 @@ class Stage {

const { current, step } = ctx.session.__scene;
const text = (ctx.message.text || ctx.message.body).toLowerCase();
const command = this.scenes[current].find(({ triggers }) => {
if (!triggers) {
return false;
if (ctx.message.text || ctx.message.body) {
const text = (ctx.message.text || ctx.message.body).toLowerCase();
const command = this.scenes[current].find(({ triggers }) => {
if (!triggers) {
return false;
}
return triggers.some(trigger => (trigger instanceof RegExp ? trigger.test(text) : text.startsWith(trigger)));
});
if (command) {
return command.fn(ctx);
}
}
return triggers.some(trigger => (trigger instanceof RegExp ? trigger.test(text) : text.startsWith(trigger)));
});
const simple = this.scenes[current][step];
if (!command && !simple) {
return console.error(`Middleware not found for ${current} scene at ${step} step`);
if (simple) {
return simple.fn(ctx);
}
if (command) {
return command.fn(ctx);
}
simple.fn(ctx);
console.error(`Middleware not found for ${current} scene at ${step} step`);
}

@@ -33,0 +37,0 @@

{
"name": "node-vk-bot-api",
"version": "2.4.3",
"version": "2.4.5",
"description": "🤖 VK bot framework for Node.js, based on Bots Long Poll API and Callback API",

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc