Socket
Socket
Sign inDemoInstall

node-vk-bot-api

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-vk-bot-api - npm Package Compare versions

Comparing version 2.0.5 to 2.1.0

3

lib/methods/startPolling.js

@@ -39,4 +39,5 @@ const axios = require('axios')

} catch (err) {
throw new Error(err)
this.longPollParams = null
this.startPolling(timeout)
}
}

@@ -38,2 +38,5 @@ class Stage {

},
selectStep: (index) => {
ctx.session.__scene.step = index
}
}

@@ -40,0 +43,0 @@

{
"name": "node-vk-bot-api",
"version": "2.0.5",
"version": "2.1.0",
"description": "🤖 Vk bot framework for Node.js",

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

@@ -125,5 +125,5 @@ [![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/)

* [.reply(message, attachment, keyboard, sticker)](#replymessage-attachment-keyboard-sticker)
* [.reply(message, attachment, markup, sticker)](#replymessage-attachment-keyboard-sticker)
### .reply(message, attachment, keyboard, sticker)
### .reply(message, attachment, markup, sticker)

@@ -140,34 +140,34 @@ Helper method for reply to the current user.

Add keyboard in message.
### Keyboards
```javascript
const VkBot = require('node-vk-bot-api')
const Markup = require('node-vk-bot-api/lib/markup')
* `Markup.keyboard(buttons)`: Create keyboard
* `Markup.button(label, color, payload)`: Create custom button
* `Markup.oneTime()`: Set oneTime to keyboard
const bot = new VkBot({
token: process.env.TOKEN,
group_id: process.env.GROUP_ID,
})
#### Simple usage
bot.command('/sport', (ctx) => {
ctx.reply('Select your sport', null, Markup
.keyboard([
'Football',
'Basketball',
])
.oneTime())
})
```js
ctx.reply('Select your sport', null, Markup
.keyboard([
'Football',
'Basketball',
])
.oneTime()
)
```
bot.command('/mood', (ctx) => {
ctx.reply('How are you doing?', null, Markup
.keyboard([
[
Markup.button('Normally', 'primary'),
],
[
Markup.button('Fine', 'positive'),
Markup.button('Bad', 'negative'),
],
]))
})
#### Advanced usage
```js
ctx.reply('How are you doing?', null, Markup
.keyboard([
[
Markup.button('Normally', 'primary'),
],
[
Markup.button('Fine', 'positive'),
Markup.button('Bad', 'negative'),
],
])
)
```

@@ -267,5 +267,2 @@

* `constructor(...scenes)`: Register scenes
* `enter(name)`: Enter in scene
* `leave()`: Leave from scene
* `next()`: Go to the next step in scene

@@ -276,4 +273,13 @@ #### Scene

#### Context
```js
ctx.scene.enter(name) // Enter in scene
ctx.scene.leave() // Leave from scene
ctx.scene.next() // Go to the next step in scene
ctx.scene.selectStep(index) // Go to the selected step in scene
```
## License
MIT.
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc