node-vk-bot-api
Advanced tools
Comparing version 2.4.10 to 2.4.11
@@ -6,7 +6,11 @@ const toArray = require('../utils/toArray'); | ||
if (Array.isArray(userId) && userId.length > 100) { | ||
throw new Error('Message can\'t be sent to more than 100 recipients.'); | ||
} | ||
this.execute( | ||
'messages.send', | ||
Object.assign( | ||
userId < 2000000000 | ||
? { user_ids: toArray(userId).join(',') } | ||
Array.isArray(userId) | ||
? { user_ids: userId.join(',') } | ||
: { peer_id: userId }, | ||
@@ -19,3 +23,3 @@ typeof args[0] === 'object' | ||
sticker_id: sticker, | ||
keyboard: keyboard ? keyboard.toJSON() : null, | ||
keyboard: keyboard ? keyboard.toJSON() : undefined, | ||
}, | ||
@@ -22,0 +26,0 @@ ), |
{ | ||
"name": "node-vk-bot-api", | ||
"version": "2.4.10", | ||
"version": "2.4.11", | ||
"description": "🤖 VK bot framework for Node.js, based on Bots Long Poll API and Callback API", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -149,2 +149,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/) | ||
// Multiple recipients | ||
bot.sendMessage([145003487, 145003488], 'Hello!', 'photo1_1') | ||
// Advanced usage | ||
@@ -151,0 +154,0 @@ bot.sendMessage(145003487, { |
37636
923
400