Socket
Socket
Sign inDemoInstall

node-vk-bot-api

Package Overview
Dependencies
1
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.2 to 3.1.0

examples/inline-keyboard.js

2

lib/api.js

@@ -7,3 +7,3 @@ const axios = require('axios');

const { data } = await axios.post(`https://api.vk.com/method/${method}`, stringify({
v: 5.80,
v: 5.103,
...settings,

@@ -10,0 +10,0 @@ }));

class Context {
constructor({ type, object: update }, bot) {
this.message = { ...update, type };
if (update.message) {
this.message = { ...update.message, type };
this.client_info = update.client_info;
} else {
this.message = { ...update, type };
}
this.bot = bot;

@@ -5,0 +11,0 @@ }

@@ -5,5 +5,5 @@ module.exports = class ApiError extends Error {

this.message = JSON.stringify(error);
this.message = 'ApiError';
this.response = error;
}
};

@@ -31,2 +31,8 @@ const KEYBOARD_COLUMNS_MAX = 4;

inline(value = true) {
this.__keyboard.inline = value;
return this;
}
toJSON() {

@@ -33,0 +39,0 @@ return JSON.stringify(this.__keyboard);

module.exports = function (method, settings, callback) {
const request = {
code: `API.${method}(${JSON.stringify({
v: '5.80',
v: '5.103',
...settings,

@@ -6,0 +6,0 @@ })})`,

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

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

@@ -304,2 +304,12 @@ [![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/)

### .inline()
Helpers method for create inline keyboard.
```js
Markup
.keyboard(['Start', 'Help'])
.inline();
```
## Sessions

@@ -306,0 +316,0 @@

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

type: 'message_new',
object: {},
},

@@ -60,2 +61,3 @@ bot.webhookCallback,

type: 'message_new',
object: {},
},

@@ -76,2 +78,3 @@ bot.webhookCallback,

type: 'message_new',
object: {},
},

@@ -89,2 +92,3 @@ bot.webhookCallback,

type: 'message_new',
object: {},
},

@@ -102,2 +106,3 @@ bot.webhookCallback,

type: 'message_new',
object: {},
secret: bot.settings.secret,

@@ -116,2 +121,3 @@ },

type: 'message_new',
object: {},
secret: bot.settings.secret,

@@ -118,0 +124,0 @@ },

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc