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.1 to 2.4.2

7

lib/stage.js

@@ -55,2 +55,9 @@ class Stage {

Object.defineProperty(ctx.scene, 'step', {
get: () => ctx.session.__scene.step,
set: (index) => {
ctx.session.__scene.step = index;
},
});
if (ctx.session.__scene && ctx.message.type === 'message_new') {

@@ -57,0 +64,0 @@ return this.enter(ctx);

2

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

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

@@ -327,3 +327,4 @@ [![node-vk-bot-api](https://img.shields.io/npm/v/node-vk-bot-api.svg?style=flat-square)](https://www.npmjs.com/package/node-vk-bot-api/)

ctx.scene.next() // Go to the next step in scene
ctx.scene.selectStep(index) // Go to the selected step in scene
ctx.scene.step // Getter for step in scene
ctx.scene.step= // Setter for step in scene
```

@@ -330,0 +331,0 @@

@@ -206,3 +206,37 @@ const { expect } = require('chai');

});
it('should get and step scene step', (done) => {
bot.middlewares = [];
const scene = new Scene('test',
(ctx) => {
expect(ctx.scene.step).to.be.equal(0);
ctx.scene.step = 4;
testSceneContext(ctx, 'test', 4);
done();
});
const session = new Session();
const stage = new Stage(scene);
bot.use(session.middleware());
bot.use(stage.middleware());
bot.on((ctx) => {
testSceneContext(ctx);
ctx.scene.enter('test');
});
bot.next({
message: {
type: 'message_new',
text: 'go',
},
});
});
});
});
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