Answer the question
In order to leave comments, you need to log in
VK bot won't start on Node JS?
Good afternoon, I decided to try to make a bot on Node.Js. I found the VK-IO library, copied the example from the documentation, but it doesn't work, tell me what I'm doing wrong?
Mistake:
/home/vk_bot/app.js:1
import { VK } from 'vk-io';
^^^^^^
SyntaxError: Cannot use import statement outside a module
import { VK } from 'vk-io';
const vk = new VK({
token: process.env.TOKEN
});
vk.updates.on('message_new', async (context) => {
if (context.text === 'Привет') {
await context.send('Привет!');
}
});
await vk.updates.start();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question