negezor / vk-io

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

Simple-bot #188

Closed MrNagaron closed 5 years ago

MrNagaron commented 5 years ago

Здравствуйте, хотел использовать https://github.com/negezor/vk-io/blob/83c59f63becd5bd5ce19688f64f0a56e7598513d/Upgrade-RU.md#simple-bot Но мне выдаёт ошибку

(node:1120) UnhandledPromiseRejectionWarning: APIError: Code №15 - Access denied
: no access to call this method
    at API.callMethod (E:\test_longpoll\node_modules\vk-io\lib\index.js:1764:30)

    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:1120) 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(). (rejection
 id: 1)
(node:1120) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre
cated. In the future, promise rejections that are not handled will terminate the
 Node.js process with a non-zero exit code.

Node v10.16.2

MrNagaron commented 5 years ago
const {VK} = require('vk-io');
const vk = new VK({
    token: 'tokens'
});

vk.updates.start();
vk.updates.hear('/start', async (context, next) => {
    await context.send('Hello!');
});
MrNagaron commented 5 years ago

Можно ли пример как использовать User Long Poll?