M
M
mrsakura522021-11-02 18:26:06
Node.js
mrsakura52, 2021-11-02 18:26:06

VK bot not working. What to do?

Node JS version - 13.14.0 (Since it's no longer possible on Windows 7)
npm version - 6.14.4

At first everything worked, the bot answered messages, after it started doubling them, that is, first one word, then if I write 2 words to him in 2 lines etc. After the restart, the bot stopped responding. There are no errors in the console, in the code, it seems, too. Why is he not responding and doubling messages?

const VkBot = require('node-vk-bot-api');
let token = "ТОКЕН"; //Специально замазан

const bot = new VkBot(token);

bot.on((ctx) => {
    let message = ctx.message.body;
    if (message != '') {
        ctx.message('Добро пожаловать!');
    }
});

bot.startPolling();


By the way, the bot is on the computer, not on the server
PS I solved the display problem myself, but the messages do not stop doubling, what should I do?
He doubles the messages and then does not react at all. 16 messages maximum sends at a time.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question