negezor / vk-io

Modern VK API SDK for Node.js
https://npm.im/vk-io
MIT License
549 stars 85 forks source link

Incorrect destructing body message from long polling result #275

Closed WhyWeLive closed 4 years ago

WhyWeLive commented 4 years ago

What did you do?

I'm writing a bot for a community that handles messages. I want to get the message that the user sent. The update comes, but the text field contains null. When I looked at the code, I saw that you were receiving the message using the text parameter, but when I made the request, I only saw the body field.

Additional Info

Logs
  vk-io:api groups.getById --> +0ms
  vk-io:api groups.getById <-- +321ms
  vk-io:api groups.getLongPollServer --> +95ms
  vk-io:api groups.getLongPollServer <-- +73ms
  vk-io:updates http --> +0ms
  vk-io:updates Bot Polling started +2ms
  vk-io:updates http <-- 200 +13s
  vk-io:updates webhook update {
  type: 'message_new',
  object: {
    id: 111,
    date: 1588952516,
    out: 0,
    user_id: 185052250,
    read_state: 0,
    title: '',
    body: 'test',
    owner_ids: []
  },
  group_id: 192951241,
  event_id: 'dfb42a1580a40adb2d0463c183f75df8f3f350fe'
} +0ms
  vk-io:updates http --> +18ms

Versions

package version
vk-io 4.0.0-rc.30
node 13.13.0
TypeScript 3.8.3
yarn or npm yarn - 1.22.4
mulfyx commented 4 years ago

Версию API в группе последнюю указали?

WhyWeLive commented 4 years ago

Нет, только сейчас увидел данный параметр, спасибо.