const toArray = require('../utils/toArray');

module.exports = function (userId, ...args) {
  const [message, attachment, keyboard, sticker] = args;

  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(
      Array.isArray(userId)
        ? { user_ids: userId.join(',') }
        : { peer_id: userId },
      typeof args[0] === 'object'
        ? args[0]
        : {
          message,
          attachment: toArray(attachment).join(','),
          sticker_id: sticker,
          keyboard: keyboard ? keyboard.toJSON() : undefined,
        },
    ),
  );
};

@@ -132,16 +132,26 @@
  sticker
+, randomId
 %5D = args
@@ -673,16 +673,61 @@
 efined,%0A
+          random_id: randomId %7C%7C Date.now(),%0A
         

Add support rundom_id in message.send (#76)