При попытке получить айди сообщения вылезает ошибка 100, в чем проблема?

Пишу бота на NodeJS, возникла проблема. Собирался написать команду, которая будет удалять пересланное сообщение.
Вот код:
cmd.hear(/^(?:-смсс)$/i, async (message, bot) => {
	if (message.hasForwards) {
    await message.loadMessagePayload();
  }
  

  
  
  message.fwds = message.forwards;
message.attachs = message.attachments;

console.log('Forwards', message.fwds[0].text, message.fwds[0].senderId);


	const sms = user.api.messages.search({ q: message.fwds[0].text, peer_id: message.fwds[0].senderId, count: 1 });
user.api.messages.delete({ message_ids: sms.id, delete_for_all: 1 }), (data, error) => {
  if (error) {
     return message.send('Ошибка выполнения метода', error)
  } else {
     console.log(data)
     return message.send('сообщение удалено')
  }
}


});


Бот запускается спокойно,но при выполнении данной команды вылезает ошибка:

(node:17647) UnhandledPromiseRejectionWarning: APIError: Code №100 - One of the parameters specified was missing or invalid: message_ids is undefined at API.callMethod (/storage/emulated/0/FBI/node_modules/vk-io/lib/index.js:1229:33) at processTicksAndRejections (internal/process/task_queues.js:93:5) (node:17647) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_reje...). (rejection id: 5)

в чем проблема?
  • Вопрос задан
  • 163 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы