Socket
Socket
Sign inDemoInstall

node-vk-bot-api

Package Overview
Dependencies
2
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.3.9 to 3.4.0

1

.eslintrc.json

@@ -16,2 +16,3 @@ {

}],
"function-paren-newline": "off",
"no-multi-spaces": "off",

@@ -18,0 +19,0 @@ "no-param-reassign": "off"

2

examples/error-handling.js

@@ -21,2 +21,2 @@ const VkBot = require('../lib');

}
});
});
class Context {
constructor({ type, object: update }, bot) {
constructor(request, bot) {
const {
type,
object: update,
event_id: eventId,
group_id: groupId,
} = request;
if (update.message) {
this.message = { ...update.message, type };
this.client_info = update.client_info;
Object.defineProperty(this, 'client_info', {
get: () => {
// eslint-disable-next-line no-console
console.warn("The 'ctx.client_info' option is deprecated. Use 'ctx.clientInfo' instead.");
return update.client_info;
},
});
this.clientInfo = update.client_info;
} else {

@@ -10,2 +27,5 @@ this.message = { ...update, type };

this.eventId = eventId;
this.groupId = groupId;
this.bot = bot;

@@ -12,0 +32,0 @@ }

module.exports = function () {
this.isStopped = false;
return this;
}
};
module.exports = function () {
this.isStopped = true;
return this;
}
};

@@ -10,3 +10,3 @@ const Request = require('../request');

}
const request = new Request(...args);

@@ -13,0 +13,0 @@

@@ -19,3 +19,4 @@ class Request {

set body(body) {
this.response.status = this.response.statusCode = 200;
this.response.status = 200;
this.response.statusCode = 200;

@@ -22,0 +23,0 @@ this.response.end(body);

{
"name": "node-vk-bot-api",
"version": "3.3.9",
"version": "3.4.0",
"description": "🤖 VK bot framework for Node.js, based on Bots Long Poll API and Callback API",
"main": "lib/index.js",
"scripts": {
"test": "mocha --exit --timeout 5000",
"eslint": "eslint .",
"eslint:fix": "eslint . --fix"
"test": "mocha -r dotenv/config --exit --timeout 5000",
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},

@@ -54,7 +54,14 @@ "repository": {

"chai": "^4.2.0",
"dotenv": "^8.2.0",
"eslint": "^5.9.0",
"eslint-config-airbnb-base": "^13.0.0",
"eslint-plugin-import": "^2.13.0",
"husky": "^4.3.8",
"mocha": "^8.2.1"
},
"husky": {
"hooks": {
"pre-commit": "npm run lint && npm test"
}
}
}

@@ -273,4 +273,6 @@ [![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/)

* ... other fields from VK API
* `eventId` - callback's eventId
* `groupId` - callback's groupId
* `match?` - regexp match of your trigger
* `client_info?` - received client info (pure object from VK API)
* `clientInfo?` - received client info (pure object from VK API)
* `bot` - instance of bot, you can call any methods via this instance

@@ -277,0 +279,0 @@

@@ -36,2 +36,10 @@ const { expect } = require('chai');

expect(ctx.groupId).to.be.a('number');
expect(ctx.eventId).to.be.a('string');
expect(ctx.client_info).to.be.an('object');
expect(ctx.clientInfo).to.be.an('object');
expect(ctx.client_info).to.be.deep.equal(ctx.clientInfo);
done();

@@ -38,0 +46,0 @@ });

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